<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Win32k: input.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Win32k
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a03290_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">kernel/input.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a03290.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a03629.html">precomp.h</a>&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#pragma hdrstop</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//#define MARKPATH</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#ifdef MARKPATH</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;BOOL gfMarkPath = 0;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#ifdef TRACESYSPEEK // is defined in userk.h</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;BOOL gbTraceSysPeek  = FALSE;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keywordtype">int</span>  gnSysPeekSearch = 0;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(<span class="keywordtype">int</span> where, <a class="code" href="a02869.html">PQ</a> pq, <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> newIdSysPeek)</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;{</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="keywordflow">if</span> (gbTraceSysPeek) {</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        KdPrint((<span class="stringliteral">&quot;%d pti %lx sets id %lx to pq %lx ; old id %lx\n&quot;</span>,</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            where, ptiCurrent, newIdSysPeek, pq, pq-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>));</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        <span class="keywordflow">if</span> (newIdSysPeek &gt; 1) {</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;            <a class="code" href="a02857.html">PQMSG</a> pqmsg = (<a class="code" href="a00365.html#ad3dfd3ee6ed128bf06b47ca3d67c652b">PQMSG</a>)newIdSysPeek;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;            KdPrint((<span class="stringliteral">&quot;-&gt; msg %lx hwnd %lx w %lx l %lx pti %lx\n&quot;</span>,</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;                pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message, pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd,  pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam,</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;                pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam,  pqmsg-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>));</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        }</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    }</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;}</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(<span class="keywordtype">int</span> where, <a class="code" href="a02869.html">PQ</a> pq, <a class="code" href="a02889.html">PTHREADINFO</a> ptiSysLock)</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;{</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordflow">if</span> (gbTraceSysPeek) {</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        KdPrint((<span class="stringliteral">&quot;%d pti %lx sets ptiSL %lx to pq %lx ; old ptiSL %lx\n&quot;</span>,</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            where, ptiCurrent, ptiSysLock, pq, pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>));</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    }</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;}</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#endif //TRACESYSPEEK</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;BOOL gfLogPlayback = FALSE;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;LPCSTR aszMouse[] = {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="stringliteral">&quot;WM_MOUSEMOVE&quot;</span>,</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="stringliteral">&quot;WM_LBUTTONDOWN&quot;</span>,</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="stringliteral">&quot;WM_LBUTTONUP&quot;</span>,</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="stringliteral">&quot;WM_LBUTTONDBLCLK&quot;</span>,</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="stringliteral">&quot;WM_RBUTTONDOWN&quot;</span>,</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="stringliteral">&quot;WM_RBUTTONUP&quot;</span>,</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="stringliteral">&quot;WM_RBUTTONDBLCLK&quot;</span>,</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="stringliteral">&quot;WM_MBUTTONDOWN&quot;</span>,</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="stringliteral">&quot;WM_MBUTTONUP&quot;</span>,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="stringliteral">&quot;WM_MBUTTONDBLCLK&quot;</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="stringliteral">&quot;WM_MOUSEWHEEL&quot;</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;};</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;LPCSTR aszKey[] = {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="stringliteral">&quot;WM_KEYDOWN&quot;</span>,</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="stringliteral">&quot;WM_KEYUP&quot;</span>,</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="stringliteral">&quot;WM_CHAR&quot;</span>,</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="stringliteral">&quot;WM_DEADCHAR&quot;</span>,</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="stringliteral">&quot;WM_SYSKEYDOWN&quot;</span>,</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="stringliteral">&quot;WM_SYSKEYUP&quot;</span>,</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="stringliteral">&quot;WM_SYSCHAR&quot;</span>,</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="stringliteral">&quot;WM_SYSDEADCHAR&quot;</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;};</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">#endif  // DBG</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">   86</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> = 0;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="a03290.html#abb0d20ebbea0c335cdef469203890401">   88</a></span>&#160;PVOID <a class="code" href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a>;</div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="a03290.html#ac43268187ecd11008c36d6e783bcf1f8">   89</a></span>&#160;PVOID <a class="code" href="a03290.html#ac43268187ecd11008c36d6e783bcf1f8">KeyStateLookasideBounds</a>;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="a03290.html#a50cffbba16c3bea57405e8726eb4b682">   90</a></span>&#160;ZONE_HEADER <a class="code" href="a03290.html#a50cffbba16c3bea57405e8726eb4b682">KeyStateLookasideZone</a>;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;ULONG AllocKeyStateHiWater;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;ULONG AllocKeyStateCalls;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;ULONG AllocKeyStateSlowCalls;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;ULONG DelKeyStateCalls;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;ULONG DelKeyStateSlowCalls;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="a03290.html#a28131755e87cbf28a25b37ad577f0999">   99</a></span>&#160;<span class="preprocessor">#define CANCEL_ACTIVESTATE  0</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="a03290.html#ad583843a0b492cedbd2015698a00caae">  100</a></span>&#160;<span class="preprocessor">#define CANCEL_FOCUSSTATE   1</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="a03290.html#a3f5fcf81ee185d4981c54b9a7fbcf264">  101</a></span>&#160;<span class="preprocessor">#define CANCEL_CAPTURESTATE 2</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="a03290.html#a3c78db181c4cbc63a66159f9de7b0b22">  103</a></span>&#160;<span class="preprocessor">#define KEYSTATESIZE    (CBKEYSTATE + CBKEYSTATERECENTDOWN)</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment"> * xxxGetNextSysMsg return values</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="a03290.html#a9c2a89c84dc8211a1e69f10e5a271ddd">  109</a></span>&#160;<span class="preprocessor">#define PQMSG_PLAYBACK       ((PQMSG)1)</span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;BOOL <a class="code" href="a03290.html#ae9dbe0a05586078bb0d0bc5762533895">xxxScanSysQueue</a>(<a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent, LPMSG lpMsg, <a class="code" href="a02581.html">PWND</a> pwndFilter,</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMinFilter, <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMaxFilter, <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> flags, <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> fsReason);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;BOOL <a class="code" href="a03290.html#a41bf5ee671d1979f26435f9c5e6eb7c3">xxxReadPostMessage</a>(<a class="code" href="a02889.html">PTHREADINFO</a> pti, LPMSG lpMsg, <a class="code" href="a02581.html">PWND</a> pwndFilter,</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMin, <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMax, BOOL fRemoveMsg);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a>(<a class="code" href="a02857.html">PQMSG</a> pqmsg);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a51cfc38140186482e8362d7bf1d3aa20">FreeQEntry</a>(<a class="code" href="a02857.html">PQMSG</a> pqmsg);</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> <a class="code" href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb">GetMouseKeyFlags</a>(<a class="code" href="a02869.html">PQ</a> pq);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="a00899.html#aa9a64bb53d41987d293b3a0df290b748">  129</a></span>&#160;BOOL <a class="code" href="a03290.html#aa9a64bb53d41987d293b3a0df290b748">xxxWaitMessage</a>(VOID)</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;{</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="a00824.html#a9fdadf9722ab6b6f80c2f840f95b2fd3">xxxSleepThread</a>(QS_ALLINPUT | QS_EVENT, 0, TRUE);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;}</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">  172</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;{</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160; </div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;<span class="comment">     * Check to see if we need to move this process into foreground</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="comment">     * priority.</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a> = 0;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp;= ~TIF_SPINNING;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a3c509629a36511ee0d17273de6b9d6af">dwTIFlags</a> = pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a>;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp; W32PF_FORCEBACKGROUNDPRIORITY) {</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="comment">         * See if any thread of this process is spinning. If none</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="comment">         * are, we can remove the force to background.</span></div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">for</span> (ptiT = pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">ptiList</a>; ptiT != NULL; ptiT = ptiT-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a>) {</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING)</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        }</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160; </div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp;= ~W32PF_FORCEBACKGROUNDPRIORITY;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a> == <a class="code" href="a03257.html#ab38a0855c4d4723984cd9e155d391e3e">gppiWantForegroundPriority</a>) {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            <a class="code" href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a>(pti, TRUE);</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        }</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    }</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;}</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="a00899.html#a51be685929c71d3ad414058fa7507b45">  220</a></span>&#160;BOOL <a class="code" href="a03290.html#aa8e4cc5f838fadab6795b0c64383ad96">xxxInternalGetMessage</a>(</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    LPMSG lpMsg,</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    HWND hwndFilter,</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMin,</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMax,</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> flags,</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    BOOL fGetMessage)</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;{</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> fsWakeBits;</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> fsWakeMask;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    PW32PROCESS W32Process;</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndFilter;</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    BOOL fLockPwndFilter;</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndFilter;</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    BOOL fRemove;</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    BOOL fExit;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="preprocessor">#ifdef MARKPATH</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> pathTaken = 0;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="preprocessor">#define PATHTAKEN(x)  pathTaken  |= x</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;<span class="preprocessor">#define DUMPPATHTAKEN() if (gfMarkPath) DbgPrint(&quot;xxxInternalGetMessage path:%08x\n&quot;, pathTaken)</span></div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;<span class="preprocessor">#define PATHTAKEN(x)</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;<span class="preprocessor">#define DUMPPATHTAKEN()</span></div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160; </div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160; </div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;<span class="comment">     * PeekMessage accepts NULL, 0x0000FFFF, and -1 as valid HWNDs.</span></div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;<span class="comment">     * If hwndFilter is invalid we can&#39;t just return FALSE because that will</span></div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<span class="comment">     * hose existing badly behaved apps who might attempt to dispatch</span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="comment">     * the random contents of pmsg.</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    <span class="keywordflow">if</span> ((hwndFilter == (HWND)-1) || (hwndFilter == (HWND)0x0000FFFF)) {</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        hwndFilter = (HWND)1;</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    }</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160; </div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <span class="keywordflow">if</span> ((hwndFilter != NULL) &amp;&amp; (hwndFilter != (HWND)1)) {</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        <span class="keywordflow">if</span> ((pwndFilter = <a class="code" href="a00293.html#a41d387d1b2d42169cbaa2092c8a02abf">ValidateHwnd</a>(hwndFilter)) == NULL) {</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;            lpMsg-&gt;hwnd = NULL;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;            lpMsg-&gt;message = WM_NULL;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(1);</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;            <a class="code" href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a>();</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;            <span class="keywordflow">if</span> (fGetMessage)</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;                <span class="keywordflow">return</span> -1;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;                <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        }</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160; </div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        ThreadLockAlwaysWithPti(pti, pwndFilter, &amp;tlpwndFilter);</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        fLockPwndFilter = TRUE;</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160; </div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        pwndFilter = (<a class="code" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>)hwndFilter;</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;        fLockPwndFilter = FALSE;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    }</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="comment">     * Add one to our spin count. At this end of this routine we&#39;ll check</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;<span class="comment">     * to see if the spin count gets &gt;= CSPINBACKGROUND. If so we&#39;ll put this</span></div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;<span class="comment">     * process into the background.</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a>++;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160; </div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;<span class="comment">     * Check to see if the startglass is on, and if so turn it off and update.</span></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    W32Process = W32GetCurrentProcess();</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keywordflow">if</span> (W32Process-&gt;W32PF_Flags &amp; W32PF_STARTGLASS) {</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160; </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;<span class="comment">         * This app is no longer in &quot;starting&quot; mode. Recalc when to hide</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;<span class="comment">         * the app starting cursor.</span></div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        W32Process-&gt;W32PF_Flags &amp;= ~W32PF_STARTGLASS;</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(NULL, 0);</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    }</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;<span class="comment">     * Next check to see if any .dlls need freeing in</span></div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;<span class="comment">     * the context of this client (used for windows hooks).</span></div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">cSysExpunge</a> != <a class="code" href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a>) {</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">cSysExpunge</a> = <a class="code" href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a>;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a2005bba2f650d045ed083841bfeb9648">dwhmodLibLoadedMask</a> &amp; <a class="code" href="a03257.html#ae6141080cfca7976a545c46fa30d5401">gdwSysExpungeMask</a>)</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;            <a class="code" href="a00737.html#a9a296006325773dbd9cc92a586007c34">xxxDoSysExpunge</a>(pti);</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    }</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160; </div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;<span class="comment">     * Set up BOOL fRemove local variable from for ReadMessage()</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    fRemove = flags &amp; PM_REMOVE;</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160; </div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;<span class="comment">     * Unlock the system queue if it&#39;s owned by us.</span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;<span class="comment">     * If we&#39;re currently processing a message, unlock the input queue</span></div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;<span class="comment">     * because the sender, who is blocked, might be the owner, and in order</span></div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="comment">     * to reply, the receiver may need to read keyboard / mouse input.</span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<span class="comment">     * If this thread has the input queue locked and the last message removed</span></div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;<span class="comment">     * is the last message we looked at, then unlock - we&#39;re ready for anyone</span></div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;<span class="comment">     * to get the next message.</span></div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    pq = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="keywordflow">if</span> (   (pti-&gt;<a class="code" href="a02889.html#a99fe3da4061cf81a351510d8e24abe5b">psmsCurrent</a> != NULL)</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;        || (pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> == pti &amp;&amp; pq-&gt;<a class="code" href="a02869.html#a271f3bdd84cb32ef7ab8c919d19ae658">idSysLock</a> == pti-&gt;<a class="code" href="a02889.html#a908f89e143de49ad52495f21d8231d8a">idLast</a>)</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;       ) {</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;        <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(1, pq, NULL);</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = NULL;</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;        <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(2);</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> &amp;&amp; (pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>-&gt;<a class="code" href="a02889.html#a829d37a7e283dd742b6972604b7097ba">cVisWindows</a> == 0) &amp;&amp;</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;            (pti-&gt;<a class="code" href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALPLAYBACK + 1] != NULL)) {</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;<span class="comment">         * If the thread that has the system queue lock has no windows visible</span></div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;<span class="comment">         * (can happen if it just hid its last window), don&#39;t expect it to call</span></div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;<span class="comment">         * GetMessage() again! - unlock the system queue. --- ScottLu</span></div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;<span class="comment">         * This condition creates a hole by which a second thread attached to</span></div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;<span class="comment">         * the same queue as thread 1 can alter pq-&gt;idSysPeek during a callback</span></div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;<span class="comment">         * made by thread 1 so that thread 1 will delete the wrong message</span></div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;<span class="comment">         * (losing keystrokes - causing Shift to appear be stuck down editing a</span></div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;<span class="comment">         * Graph5 caption embedded in Word32 document #5032.  However, MSTEST</span></div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;<span class="comment">         * requires this hole, so allow it if Journal Playback is occurring</span></div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;<span class="comment">         * #8850 (yes, a hack)  Chicago also has this behavior.  --- IanJa</span></div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;        <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(2, pq, NULL);</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = NULL;</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;        <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(3);</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    }</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> != pti) {</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a51167c8ff7f1cc33e44ee9777e1016c9">CTIF_flags</a> &amp;= ~CTIF_SYSQUEUELOCKED;</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    }</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160; </div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;<span class="comment">     * If msgMax == 0 then msgMax = -1: that makes our range checking only</span></div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;<span class="comment">     * have to deal with msgMin &lt; msgMax.</span></div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keywordflow">if</span> (msgMax == 0)</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;        msgMax--;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160; </div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;<span class="comment">     * Compute the QS* mask that corresponds to the message range.</span></div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    fsWakeMask = <a class="code" href="a00365.html#a71c025f23da9f633f32d79fa661dac06">CalcWakeMask</a>(msgMin, msgMax);</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a3f4ef466a82433ef538cc8a35f4d0907">fsChangeBitsRemoved</a> = 0;</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160; </div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;<span class="comment">     * If we can yield and one or more events were skipped,</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;<span class="comment">     * set the wakebits for event</span></div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    <span class="keywordflow">if</span> (!(flags &amp; PM_NOYIELD) &amp;&amp; pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DELAYEDEVENT) {</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> |= QS_EVENT;</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> |= QS_EVENT;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp;= ~TIF_DELAYEDEVENT;</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    }</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160; </div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    <span class="keywordflow">while</span> (TRUE) {</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160; </div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;<span class="comment">         * Restore any wake bits saved while journalling</span></div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> |= pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#ad7384d5f6cca06e0d245aaa350ba6e22">fsWakeBitsJournal</a>;</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160; </div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;<span class="comment">         * If we need to recalc queue attachments, do it here. Do it on the</span></div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;<span class="comment">         * right desktop or else the queues will get created in the wrong</span></div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;<span class="comment">         * heap.</span></div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> == <a class="code" href="a03257.html#abb2b4057bfd76cc925ae845dbb8c8390">gpdeskRecalcQueueAttach</a>) {</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;            <a class="code" href="a03257.html#abb2b4057bfd76cc925ae845dbb8c8390">gpdeskRecalcQueueAttach</a> = NULL;</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160; </div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> != NULL &amp;&amp; !FJOURNALRECORD() &amp;&amp; !FJOURNALPLAYBACK()) {</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;                <a class="code" href="a03290.html#a555a50540fc3e5009b8d9262e0702592">ReattachThreads</a>(FALSE);</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(4);</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;            }</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;        }</div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160; </div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;<span class="comment">         * Remember what change bits we&#39;re clearing. This is important to</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;<span class="comment">         * fix a bug in the input model: If an app receives a sent message</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;<span class="comment">         * from within SleepThread(), then does PostMessage() (which sets</span></div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;<span class="comment">         * QS_POSTMESSAGE), then does a PeekMessage(...) for some different</span></div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;<span class="comment">         * posted message (clears QS_POSTMESSAGE in fsChangeBits), then returns</span></div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;<span class="comment">         * back into SleepThread(), it won&#39;t wake up to retrieve that newly</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;<span class="comment">         * posted message because the change bits are cleared.</span></div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;<span class="comment">         * What we do is remember the change bits that are being cleared.</span></div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;<span class="comment">         * Then, when we return to SleepThread(), we put these remembered</span></div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;<span class="comment">         * bits back into the change bits that also have corresponding</span></div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;<span class="comment">         * bits in the wakebits (so we don&#39;t set changebits that represent</span></div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;<span class="comment">         * input that isn&#39;t there anymore). This way, the app will retrieve</span></div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;<span class="comment">         * the newly posted message refered to earlier.</span></div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;<span class="comment">         * - scottlu</span></div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a3f4ef466a82433ef538cc8a35f4d0907">fsChangeBitsRemoved</a> |= pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp; fsWakeMask;</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160; </div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;<span class="comment">         * Clear the change bits that we&#39;re looking at, in order to detect</span></div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;<span class="comment">         * incoming events that may occur the last time we checked the wake</span></div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;<span class="comment">         * bits.</span></div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp;= ~fsWakeMask;</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160; </div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;<span class="comment">         * Check to see if we have any input we want.</span></div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        xxxReceiveMessages(pti);</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;        <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; fsWakeMask) == 0) {</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(8);</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;            <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;        }</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;        fsWakeBits = pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a>;</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160; </div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;<span class="comment">         * If the queue lock is != NULL (ptiSysLock) and it is this thread that</span></div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;<span class="comment">         * locked it, then go get the message from the system queue. This is</span></div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;<span class="comment">         * to prevent messages posted after a PeekMessage/no-remove from being</span></div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;<span class="comment">         * seen before the original message from the system queue. (Aldus</span></div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;<span class="comment">         * Pagemaker requires this) (bobgu 8/5/87).</span></div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> == pti &amp;&amp;</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;                (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_LOCKNOREMOVE)) {</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;<span class="comment">             * Does the caller want mouse / keyboard?</span></div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;            <span class="keywordflow">if</span> (fsWakeBits &amp; fsWakeMask &amp; (QS_INPUT | QS_EVENT)) {</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="a03290.html#ae9dbe0a05586078bb0d0bc5762533895">xxxScanSysQueue</a>(pti, lpMsg, pwndFilter,</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;                        msgMin, msgMax, flags,</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;                        fsWakeBits &amp; fsWakeMask &amp; (QS_INPUT | QS_EVENT))) {</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160; </div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x10);</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;                }</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;            }</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;        }</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160; </div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;<span class="comment">         * See if there&#39;s a message in the application queue.</span></div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;        <span class="keywordflow">if</span> (fsWakeBits &amp; fsWakeMask &amp; QS_POSTMESSAGE) {</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03290.html#a41bf5ee671d1979f26435f9c5e6eb7c3">xxxReadPostMessage</a>(pti, lpMsg, pwndFilter,</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;                    msgMin, msgMax, fRemove)) {</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x20);</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;            }</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;        }</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160; </div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;<span class="comment">         * Time to scan the raw input queue for input. First check to see</span></div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;<span class="comment">         * if the caller wants mouse / keyboard input.</span></div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;        <span class="keywordflow">if</span> (fsWakeBits &amp; fsWakeMask &amp; (QS_INPUT | QS_EVENT)) {</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03290.html#ae9dbe0a05586078bb0d0bc5762533895">xxxScanSysQueue</a>(pti, lpMsg, pwndFilter,</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;                    msgMin, msgMax, flags,</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;                    fsWakeBits &amp; fsWakeMask &amp; (QS_INPUT | QS_EVENT))) {</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x40);</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            }</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;        }</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160; </div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;<span class="comment">         * Get new input bits, check for SendMsgs.</span></div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;        xxxReceiveMessages(pti);</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;        <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; fsWakeMask) == 0) {</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x80);</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;            <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;        }</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;        fsWakeBits = pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a>;</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160; </div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;<span class="comment">         * Does the caller want paint messages? If so, try to find a paint.</span></div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;        <span class="keywordflow">if</span> (fsWakeBits &amp; fsWakeMask &amp; QS_PAINT) {</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a00812.html#ac449d90b41476ac08ccf596bf2f8ed43">DoPaint</a>(pwndFilter, lpMsg)) {</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x100);</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;            }</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;        }</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160; </div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;<span class="comment">         * We must yield for 16 bit apps before checking timers or an app</span></div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;<span class="comment">         * that has a fast timer could chew up all the time and never let</span></div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;<span class="comment">         * anyone else run.</span></div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;<span class="comment">         * NOTE: This could cause PeekMessage() to yield TWICE, if the user</span></div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;<span class="comment">         * is filtering with a window handle. If the DoTimer() call fails</span></div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;<span class="comment">         * then we end up yielding again.</span></div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;        <span class="keywordflow">if</span> (!(flags &amp; PM_NOYIELD)) {</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;<span class="comment">             * This is the point where windows would yield.  Here we wait to wake</span></div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;<span class="comment">             * up any threads waiting for this thread to hit &quot;idle state&quot;.</span></div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;            <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(pti);</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160; </div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;<span class="comment">             * Yield and receive pending messages.</span></div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;            <a class="code" href="a00881.html#ac9a8269a485b30a2c5e5bce624f8430f">xxxUserYield</a>(pti);</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160; </div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;<span class="comment">             * Check new input buts and receive pending messages.</span></div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;            xxxReceiveMessages(pti);</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;            <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; fsWakeMask) == 0) {</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160; </div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x200);</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;            }</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;            fsWakeBits = pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a>;</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;        }</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160; </div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;<span class="comment">         * Does the app want timer messages, and if there one pending?</span></div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;        <span class="keywordflow">if</span> (fsWakeBits &amp; fsWakeMask &amp; QS_TIMER) {</div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a00887.html#a04a824f3f9528ea16629393ebda2bd6a">DoTimer</a>(pwndFilter, msgMin, msgMax)) {</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;<span class="comment">                 * DoTimer() posted the message into the app&#39;s queue,</span></div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;<span class="comment">                 * so start over and we&#39;ll grab it from there.</span></div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160; </div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x400);</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;            }</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;        }</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160; </div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;NoMessages:</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;<span class="comment">         * Looks like we have no input. If we&#39;re being called from GetMessage()</span></div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;<span class="comment">         * then go to sleep until we find something.</span></div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;        <span class="keywordflow">if</span> (!fGetMessage) {</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;<span class="comment">             * This is one last check for pending sent messages. It also</span></div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;<span class="comment">             * yields. Win3.1 does this.</span></div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;            <span class="keywordflow">if</span> (!(flags &amp; PM_NOYIELD)) {</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;<span class="comment">                 * This is the point where windows yields. Here we wait to wake</span></div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;<span class="comment">                 * up any threads waiting for this thread to hit &quot;idle state&quot;.</span></div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;                <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(pti);</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160; </div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;<span class="comment">                 * Yield and receive pending messages.</span></div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;                <a class="code" href="a00881.html#ac9a8269a485b30a2c5e5bce624f8430f">xxxUserYield</a>(pti);</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;            }</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x800);</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;            <span class="keywordflow">goto</span> FalseExit;</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;        }</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160; </div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;<span class="comment">         * This is a getmessage not a peekmessage, so sleep. When we sleep,</span></div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;<span class="comment">         * WakeInputIdle() is called to wake up any apps waiting on this</span></div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;<span class="comment">         * app to go idle.</span></div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="a00824.html#a9fdadf9722ab6b6f80c2f840f95b2fd3">xxxSleepThread</a>(fsWakeMask, 0, TRUE))</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;            <span class="keywordflow">goto</span> FalseExit;</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;    }</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160; </div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;<span class="comment">     * If we&#39;re here then we have input for this queue. Call the</span></div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;<span class="comment">     * GetMessage() hook with this input.</span></div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;    <span class="keywordflow">if</span> (IsHooked(pti, WHF_GETMESSAGE))</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;        <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HC_ACTION, flags, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)lpMsg, WH_GETMESSAGE);</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160; </div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;<span class="comment">     * If called from PeekMessage(), return TRUE.</span></div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    <span class="keywordflow">if</span> (!fGetMessage) {</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;        <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x1000);</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;        <span class="keywordflow">goto</span> TrueExit;</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;    }</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160; </div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;<span class="comment">     * Being called from GetMessage(): return FALSE if the message is WM_QUIT,</span></div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;<span class="comment">     * TRUE otherwise.</span></div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;    <span class="keywordflow">if</span> (lpMsg-&gt;message == WM_QUIT) {</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;        <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x2000);</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;        <span class="keywordflow">goto</span> FalseExit;</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;    }</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160; </div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;<span class="comment">     * Fall through to TrueExit...</span></div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160; </div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;TrueExit:</div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;<span class="comment">     * Update timeLastRead. We use this for hung app calculations.</span></div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;    SET_TIME_LAST_READ(pti);</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;    fExit = TRUE;</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x4000);</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;    <span class="keywordflow">goto</span> Exit;</div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160; </div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;FalseExit:</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;    fExit = FALSE;</div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160; </div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;Exit:</div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;    <span class="keywordflow">if</span> (fLockPwndFilter)</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;        ThreadUnlock(&amp;tlpwndFilter);</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160; </div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;<span class="comment">     * see CheckProcessBackground() comment above</span></div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;<span class="comment">     * Check to see if we need to move this process into background</span></div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;<span class="comment">     * priority.</span></div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a> &gt;= CSPINBACKGROUND) {</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160; </div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a> = 0;</div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160; </div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;        <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING)) {</div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160; </div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;            pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_SPINNING;</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;            pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a3c509629a36511ee0d17273de6b9d6af">dwTIFlags</a> = pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a>;</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160; </div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;            <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp; W32PF_FORCEBACKGROUNDPRIORITY)) {</div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160; </div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags |= W32PF_FORCEBACKGROUNDPRIORITY;</div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160; </div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a> == <a class="code" href="a03257.html#ab38a0855c4d4723984cd9e155d391e3e">gppiWantForegroundPriority</a>) {</div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;                    <a class="code" href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a>(pti, FALSE);</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;                }</div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;            }</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;        }</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160; </div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;<span class="comment">         * For spinning Message loops, we need to take the 16bit-thread out</span></div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;<span class="comment">         * of the scheduler temporarily so that other processes can get a chance</span></div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;<span class="comment">         * to run.  This is appearent in OLE operations where a 16bit foreground</span></div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;<span class="comment">         * thread starts an OLE activation on a 32bit process.  The 32bit process</span></div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;<span class="comment">         * gets starved of CPU while the 16bit thread spins.</span></div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160; </div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;<span class="comment">             * Take the 16bit thread out of the scheduler.  This wakes any</span></div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;<span class="comment">             * other 16bit thread needing time, and takes the current thread</span></div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;<span class="comment">             * out.  We will do a brief sleep so that apps can respond in time.</span></div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;<span class="comment">             * When done, we will reschedule the thread.  The WakeInputIdle()</span></div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;<span class="comment">             * should have been called in the no-messages section, so we have</span></div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;<span class="comment">             * already set the Idle-Event.</span></div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;            <a class="code" href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a>(FALSE, HEVENT_REMOVEME);</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160; </div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;            <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;            ZwYieldExecution();</div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;            CheckForClientDeath();</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;            <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160; </div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;            <a class="code" href="a00881.html#a16f932bda409a22bfb319067daffc1a1">xxxDirectedYield</a>(DY_OLDYIELD);</div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;        }</div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;    }</div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160; </div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x8000);</div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;    <a class="code" href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a>();</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;    <span class="keywordflow">return</span> fExit;</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;}</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;<span class="preprocessor">#undef PATHTAKEN</span></div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;<span class="preprocessor">#undef DUMPPATHTAKEN</span></div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160; </div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160; </div>
<div class="line"><a name="l00702"></a><span class="lineno"><a class="line" href="a00899.html#a21eb73ccd6b661f9de44419347714eb3">  702</a></span>&#160;LONG <a class="code" href="a03290.html#a389031a6d28f2691dd911f121ef30e94">xxxDispatchMessage</a>(</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;    LPMSG pmsg)</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;{</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    LONG lRet;</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd;</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;    <a class="code" href="a00365.html#aeb45e1c65bc6f45b9c278f43d805a86e">WNDPROC_PWND</a> lpfnWndProc;</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwnd;</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160; </div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;    pwnd = NULL;</div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;    <span class="keywordflow">if</span> (pmsg-&gt;hwnd != NULL) {</div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;        <span class="keywordflow">if</span> ((pwnd = <a class="code" href="a00293.html#a41d387d1b2d42169cbaa2092c8a02abf">ValidateHwnd</a>(pmsg-&gt;hwnd)) == NULL)</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;            <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;    }</div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160; </div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;<span class="comment">     * If this is a synchronous-only message (takes a pointer in wParam or</span></div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;<span class="comment">     * lParam), then don&#39;t allow this message to go through since those</span></div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;<span class="comment">     * parameters have not been thunked, and are pointing into outer-space</span></div>
<div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;<span class="comment">     * (which would case exceptions to occur).</span></div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;<span class="comment">     * (This api is only called in the context of a message loop, and you</span></div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;<span class="comment">     * don&#39;t get synchronous-only messages in a message loop).</span></div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;    <span class="keywordflow">if</span> (TESTSYNCONLYMESSAGE(pmsg-&gt;message, pmsg-&gt;wParam)) {</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;<span class="comment">         * Fail if 32 bit app is calling.</span></div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;        <span class="keywordflow">if</span> (!(<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;TIF_flags &amp; TIF_16BIT)) {</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;            <a class="code" href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a>(ERROR_INVALID_MESSAGE, <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;xxxDispatchMessage: Sync only message 0x%lX&quot;</span>,</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;                    pmsg-&gt;message);</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;            <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;        }</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160; </div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;<span class="comment">         * For wow apps, allow it to go through (for compatibility). Change</span></div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;<span class="comment">         * the message id so our code doesn&#39;t understand the message - wow</span></div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;<span class="comment">         * will get the message and strip out this bit before dispatching</span></div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;<span class="comment">         * the message to the application.</span></div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;        pmsg-&gt;message |= MSGFLAG_WOW_RESERVED;</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    }</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160; </div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;    <a class="code" href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock</a>(pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160; </div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;<span class="comment">     * Is this a timer?  If there&#39;s a proc address, call it,</span></div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;<span class="comment">     * otherwise send it to the wndproc.</span></div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;    <span class="keywordflow">if</span> ((pmsg-&gt;message == WM_TIMER) || (pmsg-&gt;message == <a class="code" href="a00953.html#a6f8d160657d70c89baa1493d9425703f">WM_SYSTIMER</a>)) {</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;        <span class="keywordflow">if</span> (pmsg-&gt;lParam != (LONG)NULL) {</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160; </div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;<span class="comment">             * System timers must be executed on the server&#39;s context.</span></div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;            <span class="keywordflow">if</span> (pmsg-&gt;message == <a class="code" href="a00953.html#a6f8d160657d70c89baa1493d9425703f">WM_SYSTIMER</a>) {</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160; </div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;<span class="comment">                 * Verify that it&#39;s a valid timer proc. If so,</span></div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="comment">                 * don&#39;t leave the critsect to call server-side procs</span></div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;<span class="comment">                 * and pass a PWND, not HWND.</span></div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;                <a class="code" href="a02981.html">PTIMER</a> ptmr;</div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;                lRet = 0;</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;                <span class="keywordflow">for</span> (ptmr = <a class="code" href="a03257.html#a84bd5c4f22ef2020477acced03c9edac">gptmrFirst</a>; ptmr != NULL; ptmr = ptmr-&gt;<a class="code" href="a02981.html#a6b5e163b766b9dff9cbd7186d638c5cd">ptmrNext</a>) {</div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;                    <span class="keywordflow">if</span> (pmsg-&gt;lParam == (LONG)ptmr-&gt;<a class="code" href="a02981.html#a09afb45dd2a93c45335dd85f35579301">pfn</a>) {</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;                        lRet = ptmr-&gt;<a class="code" href="a02981.html#a09afb45dd2a93c45335dd85f35579301">pfn</a>(pwnd, <a class="code" href="a00953.html#a6f8d160657d70c89baa1493d9425703f">WM_SYSTIMER</a>, pmsg-&gt;wParam,</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;                                         NtGetTickCount());</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;                    }</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;                }</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;                <span class="keywordflow">goto</span> Exit;</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;<span class="comment">                 * WM_TIMER is the same for Unicode/ANSI.</span></div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;                <a class="code" href="a02889.html">PTHREADINFO</a> pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160; </div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SYSTEMTHREAD)</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;                    <span class="keywordflow">goto</span> Exit;</div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160; </div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;                lRet = CallClientProcA(pwnd, WM_TIMER,</div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;                       pmsg-&gt;wParam, NtGetTickCount(), pmsg-&gt;lParam);</div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160; </div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;                <span class="keywordflow">goto</span> Exit;</div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;            }</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;        }</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;    }</div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160; </div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;<span class="comment">     * Check to see if pwnd is NULL AFTER the timer check.  Apps can set</span></div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;<span class="comment">     * timers with NULL hwnd&#39;s, that&#39;s totally legal.  But NULL hwnd messages</span></div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;<span class="comment">     * don&#39;t get dispatched, so check here after the timer case but before</span></div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;<span class="comment">     * dispatching - if it&#39;s NULL, just return 0.</span></div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;    <span class="keywordflow">if</span> (pwnd == NULL) {</div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;        lRet = 0;</div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;        <span class="keywordflow">goto</span> Exit;</div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;    }</div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160; </div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;<span class="comment">     * If we&#39;re dispatching a WM_PAINT message, set a flag to be used to</span></div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;<span class="comment">     * determine whether it was processed properly.</span></div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;    <span class="keywordflow">if</span> (pmsg-&gt;message == WM_PAINT)</div>
<div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;        SetWF(pwnd, WFPAINTNOTPROCESSED);</div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160; </div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;<span class="comment">     * If this window&#39;s proc is meant to be executed from the server side</span></div>
<div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;<span class="comment">     * we&#39;ll just stay inside the semaphore and call it directly.  Note</span></div>
<div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;<span class="comment">     * how we don&#39;t convert the pwnd into an hwnd before calling the proc.</span></div>
<div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160;    <span class="keywordflow">if</span> (TestWF(pwnd, WFSERVERSIDEPROC)) {</div>
<div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160;        <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> fnMessageType;</div>
<div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160; </div>
<div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;        fnMessageType = pmsg-&gt;message &gt;= WM_USER ? (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)SfnDWORD :</div>
<div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;                (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)<a class="code" href="a03263.html#ab55bcf13c45e6055491901b6617a930c">gapfnScSendMessage</a>[pmsg-&gt;message];</div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160; </div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;<span class="comment">         * Convert the WM_CHAR from ANSI to UNICODE if the source was ANSI</span></div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;        <span class="keywordflow">if</span> (fnMessageType == (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)SfnINWPARAMCHAR &amp;&amp; TestWF(pwnd, WFANSIPROC)) {</div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>() == GETPTI(pwnd)); <span class="comment">// use receiver&#39;s codepage</span></div>
<div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;            <a class="code" href="a00365.html#a422181d432442f3ca223ed68ff5585fb">RtlMBMessageWParamCharToWCS</a>(pmsg-&gt;message, (PDWORD)&amp;pmsg-&gt;wParam);</div>
<div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;        }</div>
<div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160; </div>
<div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;        lRet = pwnd-&gt;<a class="code" href="a02581.html#ae7a5a1d213bfe6dce2e6eab68a2a8bb8">lpfnWndProc</a>(pwnd, pmsg-&gt;message, pmsg-&gt;wParam,</div>
<div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160;                pmsg-&gt;lParam);</div>
<div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;        <span class="keywordflow">goto</span> Exit;</div>
<div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;    }</div>
<div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160; </div>
<div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160;<span class="comment">     * Cool people dereference any window structure members before they</span></div>
<div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;<span class="comment">     * leave the critsect.</span></div>
<div class="line"><a name="l00835"></a><span class="lineno">  835</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;    lpfnWndProc = pwnd-&gt;<a class="code" href="a02581.html#ae7a5a1d213bfe6dce2e6eab68a2a8bb8">lpfnWndProc</a>;</div>
<div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160; </div>
<div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;    {</div>
<div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160;<span class="comment">         * If we&#39;re dispatching the message to an ANSI wndproc we need to</span></div>
<div class="line"><a name="l00841"></a><span class="lineno">  841</span>&#160;<span class="comment">         * convert the character messages from Unicode to Ansi.</span></div>
<div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160;        <span class="keywordflow">if</span> (TestWF(pwnd, WFANSIPROC)) {</div>
<div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>() == GETPTI(pwnd)); <span class="comment">// use receiver&#39;s codepage</span></div>
<div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;            <a class="code" href="a00365.html#a541a4d80afc3abe77692be2160e0f354">RtlWCSMessageWParamCharToMB</a>(pmsg-&gt;message, (PDWORD)&amp;pmsg-&gt;wParam);</div>
<div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;            lRet = CallClientProcA(pwnd, pmsg-&gt;message,</div>
<div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160;                    pmsg-&gt;wParam, pmsg-&gt;lParam, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)lpfnWndProc);</div>
<div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160;            lRet = CallClientProcW(pwnd, pmsg-&gt;message,</div>
<div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;                    pmsg-&gt;wParam, pmsg-&gt;lParam, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)lpfnWndProc);</div>
<div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;        }</div>
<div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;    }</div>
<div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160; </div>
<div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;<span class="comment">     * If we dispatched a WM_PAINT message and it wasn&#39;t properly</span></div>
<div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160;<span class="comment">     * processed, do the drawing here.</span></div>
<div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160;    <span class="keywordflow">if</span> (pmsg-&gt;message == WM_PAINT &amp;&amp; RevalidateHwnd(pmsg-&gt;hwnd) &amp;&amp;</div>
<div class="line"><a name="l00859"></a><span class="lineno">  859</span>&#160;            TestWF(pwnd, WFPAINTNOTPROCESSED)) {</div>
<div class="line"><a name="l00860"></a><span class="lineno">  860</span>&#160;        <span class="comment">//RIPMSG0(RIP_WARNING,</span></div>
<div class="line"><a name="l00861"></a><span class="lineno">  861</span>&#160;        <span class="comment">//    &quot;Missing BeginPaint or GetUpdateRect/Rgn(fErase == TRUE) in WM_PAINT&quot;);</span></div>
<div class="line"><a name="l00862"></a><span class="lineno">  862</span>&#160;        ClrWF(pwnd, WFWMPAINTSENT);</div>
<div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;        <a class="code" href="a00812.html#a5fb5c8d8d77f78f43a8154e065390763">xxxSimpleDoSyncPaint</a>(pwnd);</div>
<div class="line"><a name="l00864"></a><span class="lineno">  864</span>&#160;    }</div>
<div class="line"><a name="l00865"></a><span class="lineno">  865</span>&#160; </div>
<div class="line"><a name="l00866"></a><span class="lineno">  866</span>&#160;Exit:</div>
<div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160;    ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;    <span class="keywordflow">return</span> lRet;</div>
<div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;}</div>
<div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160; </div>
<div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160; </div>
<div class="line"><a name="l00881"></a><span class="lineno"><a class="line" href="a03290.html#a99a70efa3fef53480bd7b13a85f3a7c1">  881</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a99a70efa3fef53480bd7b13a85f3a7c1">AdjustForCoalescing</a>(</div>
<div class="line"><a name="l00882"></a><span class="lineno">  882</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml,</div>
<div class="line"><a name="l00883"></a><span class="lineno">  883</span>&#160;    HWND hwnd,</div>
<div class="line"><a name="l00884"></a><span class="lineno">  884</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message)</div>
<div class="line"><a name="l00885"></a><span class="lineno">  885</span>&#160;{</div>
<div class="line"><a name="l00886"></a><span class="lineno">  886</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;<span class="comment">     * First see if this message is in that range.</span></div>
<div class="line"><a name="l00888"></a><span class="lineno">  888</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;    <span class="keywordflow">if</span> (!CheckMsgFilter(message, WM_COALESCE_FIRST, WM_COALESCE_LAST))</div>
<div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160; </div>
<div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> == NULL)</div>
<div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160; </div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message != message)</div>
<div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160; </div>
<div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd != hwnd)</div>
<div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00900"></a><span class="lineno">  900</span>&#160; </div>
<div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;<span class="comment">     * The message and hwnd are the same, so delete this message and</span></div>
<div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;<span class="comment">     * the new one will added later.</span></div>
<div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;    <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(pml, pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>);</div>
<div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;}</div>
<div class="line"><a name="l00907"></a><span class="lineno">  907</span>&#160; </div>
<div class="line"><a name="l00908"></a><span class="lineno">  908</span>&#160; </div>
<div class="line"><a name="l00918"></a><span class="lineno"><a class="line" href="a00899.html#ac631ad721186e0a430ac07b6d6189257">  918</a></span>&#160;BOOL <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(</div>
<div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> wParam,</div>
<div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;    LONG lParam)</div>
<div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;{</div>
<div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;    BOOL fPwndUnlock;</div>
<div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;    BOOL fRet;</div>
<div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwPostCode;</div>
<div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwnd;</div>
<div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160; </div>
<div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;<span class="comment">     * First check to see if this message takes DWORDs only. If it does not,</span></div>
<div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;<span class="comment">     * fail the post. Cannot allow an app to post a message with pointers or</span></div>
<div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;<span class="comment">     * handles in it - this can cause the server to fault and cause other</span></div>
<div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160;<span class="comment">     * problems - such as causing apps in separate address spaces to fault.</span></div>
<div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;<span class="comment">     * (or even an app in the same address space to fault!)</span></div>
<div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;    <span class="keywordflow">if</span> (TESTSYNCONLYMESSAGE(message, wParam)) {</div>
<div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;        <a class="code" href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a>(ERROR_INVALID_PARAMETER,</div>
<div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;                <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;                <span class="stringliteral">&quot;Invalid parameter \&quot;message\&quot; (%ld) to _PostMessage&quot;</span>,</div>
<div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;                message);</div>
<div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160; </div>
<div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;    }</div>
<div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160; </div>
<div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;<span class="comment">     * Is this a BroadcastMsg()?</span></div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;    <span class="keywordflow">if</span> ((pwnd == (<a class="code" href="a02581.html">PWND</a>)-1) || (pwnd == (<a class="code" href="a02581.html">PWND</a>)0xFFFF)) {</div>
<div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;        <a class="code" href="a00842.html#adb5204decd255d5005372b2c12890113">xxxBroadcastMessage</a>(NULL, message, wParam, lParam, BMSG_POSTMSG, NULL);</div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;    }</div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160; </div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160; </div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;<span class="comment">     * Is this posting to the current thread info?</span></div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;    <span class="keywordflow">if</span> (pwnd == NULL) {</div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a7bb16e9d18954c3ef50ae8bc75f89c5d">_PostThreadMessage</a>(pti, message, wParam, lParam);</div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;    }</div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160; </div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;    fPwndUnlock = FALSE;</div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;    <span class="keywordflow">if</span> (message &gt;= WM_DDE_FIRST &amp;&amp; message &lt;= WM_DDE_LAST) {</div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;        ThreadLockAlwaysWithPti(pti, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;        dwPostCode = <a class="code" href="a03188.html#a6a4f1209e6b46089d96dfc7dc5eb5207">xxxDDETrackPostHook</a>(&amp;message, pwnd, wParam, &amp;lParam, FALSE);</div>
<div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160; </div>
<div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;        <span class="keywordflow">if</span> (dwPostCode != <a class="code" href="a00338.html#a80475b6dfa016b055a2db28e2a8ec467">DO_POST</a>) {</div>
<div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;            ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160;            <span class="keywordflow">return</span>(dwPostCode == <a class="code" href="a00338.html#ab6b030d454ca012e42ab1be328dd14a2">FAKE_POST</a>);</div>
<div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;        }</div>
<div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160; </div>
<div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;        fPwndUnlock = TRUE;</div>
<div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160;    }</div>
<div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160; </div>
<div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160;    pti = GETPTI(pwnd);</div>
<div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160; </div>
<div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;<span class="comment">     * Check to see if this message is in the multimedia coalescing range.</span></div>
<div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;<span class="comment">     * If so, see if it can be coalesced with the previous message.</span></div>
<div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;    <a class="code" href="a03290.html#a99a70efa3fef53480bd7b13a85f3a7c1">AdjustForCoalescing</a>(&amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>, HWq(pwnd), message);</div>
<div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160; </div>
<div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;<span class="comment">     * Allocate a key state update event if needed.</span></div>
<div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;    <span class="keywordflow">if</span> (message &gt;= WM_KEYFIRST &amp;&amp; message &lt;= WM_KEYLAST) {</div>
<div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;        <a class="code" href="a03290.html#a3c7a65a04f65f7c71626a1cca090a475">PostUpdateKeyStateEvent</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>);</div>
<div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;    }</div>
<div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160; </div>
<div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;<span class="comment">     * Put this message on the &#39;post&#39; list.</span></div>
<div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;    fRet = FALSE;</div>
<div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;    <span class="keywordflow">if</span> ((pqmsg = <a class="code" href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a>(&amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>)) != NULL) {</div>
<div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;<span class="comment">         * Set the QS_POSTMESSAGE bit so the thread knows it has a message.</span></div>
<div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160;        <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(pqmsg, pwnd, message, wParam, lParam, 0, 0);</div>
<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>&#160; </div>
<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160;<span class="comment">         * If it&#39;s a hotkey, set the QS_HOTKEY bit since we have a separate</span></div>
<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;<span class="comment">         * bit for those messages.</span></div>
<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;        <span class="keywordflow">if</span> (message == WM_HOTKEY)</div>
<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;            <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_HOTKEY);</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160; </div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160;        fRet = TRUE;</div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;    }</div>
<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160; </div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;<span class="comment">     * Are we posting to the thread currently reading from the input queue?</span></div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;<span class="comment">     * If so, update idSysLock with this pqmsg so that the input queue will</span></div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;<span class="comment">     * not be unlocked until this message is read.</span></div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;    <span class="keywordflow">if</span> (pti == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>)</div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a271f3bdd84cb32ef7ab8c919d19ae658">idSysLock</a> = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pqmsg;</div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160; </div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;    <span class="keywordflow">if</span> (fPwndUnlock)</div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;        ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160; </div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;    <span class="keywordflow">return</span> fRet;</div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;}</div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160; </div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160; </div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160; </div>
<div class="line"><a name="l01039"></a><span class="lineno"><a class="line" href="a00899.html#a1fd172260ffff663b17ed4d024cdcce7"> 1039</a></span>&#160;BOOL <a class="code" href="a03290.html#a1fd172260ffff663b17ed4d024cdcce7">_PostQuitMessage</a>(</div>
<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;    <span class="keywordtype">int</span> nExitCode)</div>
<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;{</div>
<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160; </div>
<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160; </div>
<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> = 1;</div>
<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ad2b39e24db61b348a98aee43f81aac9c">exitCode</a> = nExitCode;</div>
<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;    <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160; </div>
<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;}</div>
<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160; </div>
<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160; </div>
<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160; </div>
<div class="line"><a name="l01064"></a><span class="lineno"><a class="line" href="a00899.html#a7bb16e9d18954c3ef50ae8bc75f89c5d"> 1064</a></span>&#160;BOOL <a class="code" href="a03290.html#a7bb16e9d18954c3ef50ae8bc75f89c5d">_PostThreadMessage</a>(</div>
<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>        message,</div>
<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>       wParam,</div>
<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>&#160;    LONG        lParam)</div>
<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>&#160;{</div>
<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>&#160; </div>
<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>&#160;    <span class="keywordflow">if</span> ((pti == NULL)                                ||</div>
<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>&#160;        !(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_GUITHREADINITIALIZED) ||</div>
<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>&#160;        (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_INCLEANUP)) {</div>
<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>&#160; </div>
<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>&#160;        <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_INVALID_THREAD_ID, <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>&#160;    }</div>
<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>&#160; </div>
<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>&#160;<span class="comment">     * First check to see if this message takes DWORDs only. If it does not,</span></div>
<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>&#160;<span class="comment">     * fail the post. Cannot allow an app to post a message with pointers or</span></div>
<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>&#160;<span class="comment">     * handles in it - this can cause the server to fault and cause other</span></div>
<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>&#160;<span class="comment">     * problems - such as causing apps in separate address spaces to fault.</span></div>
<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>&#160;<span class="comment">     * (or even an app in the same address space to fault!)</span></div>
<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>&#160;    <span class="keywordflow">if</span> (TESTSYNCONLYMESSAGE(message, wParam)) {</div>
<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>&#160;        <a class="code" href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a>(ERROR_INVALID_PARAMETER,</div>
<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>&#160;                <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>&#160;                <span class="stringliteral">&quot;Invalid parameter \&quot;message\&quot; (%ld) to _PostThreadMessage&quot;</span>,</div>
<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>&#160;                message);</div>
<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>&#160; </div>
<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>&#160;    }</div>
<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>&#160; </div>
<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;<span class="comment">     * Check to see if this message is in the multimedia coalescing range.</span></div>
<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;<span class="comment">     * If so, see if it can be coalesced with the previous message.</span></div>
<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;    <a class="code" href="a03290.html#a99a70efa3fef53480bd7b13a85f3a7c1">AdjustForCoalescing</a>(&amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>, NULL, message);</div>
<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160; </div>
<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>&#160;<span class="comment">     * Put this message on the &#39;post&#39; list.</span></div>
<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>&#160;    <span class="keywordflow">if</span> ((pqmsg = <a class="code" href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a>(&amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>)) == NULL)</div>
<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>&#160; </div>
<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>&#160;<span class="comment">     * Set the QS_POSTMESSAGE bit so the thread knows it has a message.</span></div>
<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>&#160;    <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(pqmsg, NULL, message, wParam, lParam, 0, 0);</div>
<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160;    <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160; </div>
<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;<span class="comment">     * If it&#39;s a hotkey, set the QS_HOTKEY bit since we have a separate</span></div>
<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;<span class="comment">     * bit for those messages.</span></div>
<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160;    <span class="keywordflow">if</span> (message == WM_HOTKEY)</div>
<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_HOTKEY);</div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160; </div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;<span class="comment">     * Are we posting to the thread currently reading from the input queue?</span></div>
<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;<span class="comment">     * If so, update idSysLock with this pqmsg so that the input queue will</span></div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;<span class="comment">     * not be unlocked until this message is read.</span></div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;    <span class="keywordflow">if</span> (pti == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>)</div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a271f3bdd84cb32ef7ab8c919d19ae658">idSysLock</a> = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pqmsg;</div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160; </div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;}</div>
<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160; </div>
<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160; </div>
<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160; </div>
<div class="line"><a name="l01143"></a><span class="lineno"><a class="line" href="a00899.html#a6ae751736a3e6ef5b3f10816af604719"> 1143</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a03290.html#a6ae751736a3e6ef5b3f10816af604719">_GetMessagePos</a>(VOID)</div>
<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;{</div>
<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160; </div>
<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160; </div>
<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160;    <span class="keywordflow">return</span> MAKELONG((SHORT)pti-&gt;<a class="code" href="a02889.html#a82665c77f0395ea674ade3c7a96bd9d1">ptLast</a>.x, (SHORT)pti-&gt;<a class="code" href="a02889.html#a82665c77f0395ea674ade3c7a96bd9d1">ptLast</a>.y);</div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;}</div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160; </div>
<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160; </div>
<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160; </div>
<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;<span class="preprocessor">#ifdef SYSMODALWINDOWS</span></div>
<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160; </div>
<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160;<a class="code" href="a02581.html">PWND</a> <a class="code" href="a00953.html#a428a91acf2c2439dc1a257708ee1f805">APIENTRY</a> _SetSysModalWindow(</div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd)</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;{</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;    pwnd;</div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160;    <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;}</div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160; </div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160; </div>
<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>&#160; </div>
<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;<a class="code" href="a02581.html">PWND</a> <a class="code" href="a00953.html#a428a91acf2c2439dc1a257708ee1f805">APIENTRY</a> _GetSysModalWindow(VOID)</div>
<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160;{</div>
<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;    <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;}</div>
<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;<span class="preprocessor">#endif //LATER</span></div>
<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160; </div>
<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160; </div>
<div class="line"><a name="l01192"></a><span class="lineno"><a class="line" href="a00899.html#aff53b969878a227a8d1b2a15f3439fc9"> 1192</a></span>&#160;VOID <a class="code" href="a03290.html#aff53b969878a227a8d1b2a15f3439fc9">PostMove</a>(</div>
<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq)</div>
<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;{</div>
<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160;    <a class="code" href="a03290.html#a4856d1f1e3808b8a272edd102d0d78ef">PostInputMessage</a>(pq, NULL, WM_MOUSEMOVE, 0,</div>
<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>&#160;            MAKELONG((SHORT)ptCursor.x, (SHORT)ptCursor.y),</div>
<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>&#160;            <a class="code" href="a03257.html#a03e1a78fe19125d5809a8e6ecd22294d">dwMouseMoveExtraInfo</a>);</div>
<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>&#160; </div>
<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_MOUSEMOVED;</div>
<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>&#160;}</div>
<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>&#160; </div>
<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>&#160; </div>
<div class="line"><a name="l01213"></a><span class="lineno"><a class="line" href="a00899.html#a67abc9d7678097e0d7225e4af7f7973d"> 1213</a></span>&#160;VOID <a class="code" href="a03290.html#a67abc9d7678097e0d7225e4af7f7973d">SetFMouseMoved</a>(</div>
<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;    VOID)</div>
<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;{</div>
<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd;</div>
<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndOldCursor;</div>
<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq;</div>
<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160; </div>
<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>&#160;<span class="comment">     * Need to first figure out what queue this mouse event is in. Do NOT</span></div>
<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;<span class="comment">     * check for mouse capture here !! Talk to scottlu.</span></div>
<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;    <span class="keywordflow">if</span> ((pwnd = <a class="code" href="a03257.html#a66d75018ac18b148273ed2f14fd0e186">gspwndScreenCapture</a>) == NULL) {</div>
<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160;        <span class="keywordflow">if</span> ((pwnd = <a class="code" href="a03257.html#ab581288d85a9ba3563162af65596e427">gspwndMouseOwner</a>) == NULL) {</div>
<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;            <span class="keywordflow">if</span> ((pwnd = <a class="code" href="a03257.html#a8534ae64a3a0d32b8727b62158bd1d34">gspwndInternalCapture</a>) == NULL) {</div>
<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>&#160;                pwnd = <a class="code" href="a00899.html#aa2b52134e7cd2fc791c9920e4a8d89bb">SpeedHitTest</a>(<a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>, ptCursor);</div>
<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;            }</div>
<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>&#160;        }</div>
<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>&#160;    }</div>
<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>&#160; </div>
<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160;    <span class="keywordflow">if</span> (pwnd == NULL)</div>
<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>&#160; </div>
<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>&#160;<span class="comment">     * This is apparently needed by the attach/unattach code for some</span></div>
<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>&#160;<span class="comment">     * reason. I&#39;d like to get rid of it - scottlu.</span></div>
<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>&#160;    pwndOldCursor = Lock(&amp;<a class="code" href="a03257.html#a2cff4327a97c844cd113c0dae7541390">gspwndCursor</a>, pwnd);</div>
<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>&#160; </div>
<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>&#160;<span class="comment">     * If we&#39;re giving a mouse move to a new queue, be sure the cursor</span></div>
<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>&#160;<span class="comment">     * image represents what this queue thinks it should be.</span></div>
<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>&#160;    pq = GETPTI(pwnd)-&gt;pq;</div>
<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;    <span class="keywordflow">if</span> (pq != <a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>) {</div>
<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;<span class="comment">         * If the old queue had the mouse captured, let him know that</span></div>
<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;<span class="comment">         * the mouse moved first. Need this to fix tooltips in</span></div>
<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;<span class="comment">         * WordPerfect Office. Do the same for mouse tracking.</span></div>
<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a> != NULL) {</div>
<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a> != NULL) {</div>
<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160;                <a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_MOUSEMOVED;</div>
<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;                <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(GETPTI(<a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>), QS_MOUSEMOVE);</div>
<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;            }</div>
<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a> != NULL) {</div>
<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;                <a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_MOUSEMOVED;</div>
<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;                <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(GETPTI(<a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a>-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>), QS_MOUSEMOVE);</div>
<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;            }</div>
<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160;        }</div>
<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160; </div>
<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;<span class="comment">         * First re-assign gpqCursor so any SetCursor() calls</span></div>
<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>&#160;<span class="comment">         * will only take effect if done by the thread that</span></div>
<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>&#160;<span class="comment">         * owns the window the mouse is currently over.</span></div>
<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>&#160;        <a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a> = pq;</div>
<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>&#160; </div>
<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>&#160;<span class="comment">         * Call UpdateCursorImage() so the new gpqCursor&#39;s</span></div>
<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>&#160;<span class="comment">         * notion of the current cursor is represented.</span></div>
<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>&#160;        <a class="code" href="a00638.html#a9f0bf38c04ea2aeebbf17e5f1353ea34">UpdateCursorImage</a>();</div>
<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>&#160; </div>
<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>&#160;    }</div>
<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160; </div>
<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;<span class="comment">     * Set the mouse moved bit for this queue so we know later to post</span></div>
<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;<span class="comment">     * a move message to this queue.</span></div>
<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_MOUSEMOVED;</div>
<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160; </div>
<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;<span class="comment">     * Reassign mouse input to this thread - this indicates which thread</span></div>
<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>&#160;<span class="comment">     * to wake up when new input comes in.</span></div>
<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;    pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> = GETPTI(pwnd);</div>
<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160; </div>
<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;<span class="comment">     * Wake some thread within this queue to process this mouse event.</span></div>
<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;    <a class="code" href="a03290.html#a0a3fd3f307e80195c7f13545ec5fbcff">WakeSomeone</a>(pq, WM_MOUSEMOVE, NULL);</div>
<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>&#160; </div>
<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;<span class="comment">     * We&#39;re possibly generating a fake mouse move message - it has no</span></div>
<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>&#160;<span class="comment">     * extra info associated with it - so 0 it out.</span></div>
<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>&#160;    <a class="code" href="a03257.html#a03e1a78fe19125d5809a8e6ecd22294d">dwMouseMoveExtraInfo</a> = 0;</div>
<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>&#160;}</div>
<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>&#160; </div>
<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>&#160; </div>
<div class="line"><a name="l01316"></a><span class="lineno"><a class="line" href="a00899.html#a155a894ac34924dc3551affcf39edd32"> 1316</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a155a894ac34924dc3551affcf39edd32">CancelForegroundActivate</a>()</div>
<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;{</div>
<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppiT;</div>
<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160; </div>
<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a>) {</div>
<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160; </div>
<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;        <span class="keywordflow">for</span> (ppiT = <a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a>; ppiT != NULL; ppiT = ppiT-&gt;<a class="code" href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">ppiNext</a>) {</div>
<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;<span class="comment">             * Don&#39;t cancel activation if the app is being debugged - if</span></div>
<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;<span class="comment">             * the debugger stops the application before it has created and</span></div>
<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;<span class="comment">             * activated its first window, the app will come up behind all</span></div>
<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;<span class="comment">             * others - not what you want when being debugged.</span></div>
<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;            <span class="keywordflow">if</span> (!ppiT-&gt;Process-&gt;DebugPort)</div>
<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;                ppiT-&gt;W32PF_Flags &amp;= ~W32PF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;        }</div>
<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160; </div>
<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;        <a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a> = FALSE;</div>
<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160;    }</div>
<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;}</div>
<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160; </div>
<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>&#160; </div>
<div class="line"><a name="l01347"></a><span class="lineno"><a class="line" href="a00899.html#a24dc3b06f6569c1599489d59841e2058"> 1347</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a24dc3b06f6569c1599489d59841e2058">RestoreForegroundActivate</a>()</div>
<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>&#160;{</div>
<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppiT;</div>
<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>&#160;    <span class="keyword">extern</span> BOOL <a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a>;</div>
<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>&#160; </div>
<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>&#160;    <span class="keywordflow">for</span> (ppiT = <a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a>; ppiT != NULL; ppiT = ppiT-&gt;<a class="code" href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">ppiNext</a>) {</div>
<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>&#160;        <span class="keywordflow">if</span> (ppiT-&gt;W32PF_Flags &amp; W32PF_APPSTARTING) {</div>
<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>&#160;            ppiT-&gt;W32PF_Flags |= W32PF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>&#160;            <a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a> = TRUE;</div>
<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>&#160;        }</div>
<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>&#160;    }</div>
<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>&#160;}</div>
<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>&#160; </div>
<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>&#160; </div>
<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>&#160; </div>
<div class="line"><a name="l01372"></a><span class="lineno"><a class="line" href="a00899.html#a4856d1f1e3808b8a272edd102d0d78ef"> 1372</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a4856d1f1e3808b8a272edd102d0d78ef">PostInputMessage</a>(</div>
<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> wParam,</div>
<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>&#160;    LONG lParam,</div>
<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwExtraInfo)</div>
<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>&#160;{</div>
<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgInput, pqmsgPrev;</div>
<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>&#160;    <span class="keywordtype">short</span> sWheelDelta;</div>
<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160; </div>
<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160;<span class="comment">     * Grab the last written message before we start allocing new ones,</span></div>
<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;<span class="comment">     * so we&#39;re sure to point to the correct message.</span></div>
<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>&#160;    pqmsgPrev = pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>;</div>
<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160; </div>
<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>&#160;<span class="comment">     * Allocate a key state update event if needed.</span></div>
<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_UPDATEKEYSTATE) {</div>
<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>&#160;        <a class="code" href="a03290.html#a3c7a65a04f65f7c71626a1cca090a475">PostUpdateKeyStateEvent</a>(pq);</div>
<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>&#160;    }</div>
<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>&#160; </div>
<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>&#160;<span class="comment">     * We want to coalesce sequential WM_MOUSEMOVE and WM_MOUSEWHEEL.</span></div>
<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>&#160;<span class="comment">     * WM_MOUSEMOVEs are coalesced by just storing the most recent</span></div>
<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>&#160;<span class="comment">     * event over the last one.</span></div>
<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>&#160;<span class="comment">     * WM_MOUSEWHEELs also add up the wheel rolls.</span></div>
<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>&#160;    <span class="keywordflow">if</span> (pqmsgPrev != NULL &amp;&amp;</div>
<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>&#160;        pqmsgPrev-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message == message &amp;&amp;</div>
<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>&#160;        (message == WM_MOUSEMOVE || message == WM_MOUSEWHEEL)) {</div>
<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>&#160; </div>
<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>&#160;        <span class="keywordflow">if</span> (message == WM_MOUSEWHEEL) {</div>
<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>&#160;            sWheelDelta = (short)HIWORD(wParam) + (short)HIWORD(pqmsgPrev-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>&#160; </div>
<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>&#160;<span class="preprocessor">#if 0</span></div>
<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>&#160;<span class="comment">             * LATER: We can&#39;t remove a wheel message with zero delta</span></div>
<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>&#160;<span class="comment">             * unless we know it hasn&#39;t been peeked. Ideally,</span></div>
<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>&#160;<span class="comment">             * we would check idsyspeek for this, but we&#39;re too close</span></div>
<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>&#160;<span class="comment">             * to ship and idsyspeek is too fragile. Consider also</span></div>
<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>&#160;<span class="comment">             * checking to see if mouse move messages have been peeked.</span></div>
<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>&#160; </div>
<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>&#160;            <span class="keywordflow">if</span> (sWheelDelta == 0) {</div>
<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>&#160;                <span class="keywordflow">if</span> ((<a class="code" href="a02857.html">PQMSG</a>)pq-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> == pqmsgPrev) {</div>
<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>&#160;                    <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>,</div>
<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>&#160;                            <span class="stringliteral">&quot;Coalescing of mouse wheel messages causing &quot;</span></div>
<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>&#160;                            <span class="stringliteral">&quot;idSysPeek to be reset to 0&quot;</span>);</div>
<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>&#160; </div>
<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>&#160;                    pq-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>&#160;                }</div>
<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>&#160; </div>
<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>&#160;                <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>, pqmsgPrev);</div>
<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>&#160;            }</div>
<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>&#160; </div>
<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>&#160;            wParam = MAKEWPARAM(LOWORD(wParam), sWheelDelta);</div>
<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>&#160;        }</div>
<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>&#160; </div>
<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>&#160;        <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(pqmsgPrev, pwnd, message, wParam, lParam, 0, dwExtraInfo);</div>
<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>&#160;        <a class="code" href="a03290.html#a0a3fd3f307e80195c7f13545ec5fbcff">WakeSomeone</a>(pq, message, pqmsgPrev);</div>
<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>&#160; </div>
<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>&#160;    }</div>
<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>&#160; </div>
<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>&#160;<span class="comment">     * Fill in pqmsgInput.</span></div>
<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>&#160;    pqmsgInput = <a class="code" href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>&#160;    <span class="keywordflow">if</span> (pqmsgInput != NULL) {</div>
<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>&#160;        <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(pqmsgInput, pwnd, message, wParam, lParam, 0, dwExtraInfo);</div>
<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>&#160;        <a class="code" href="a03290.html#a0a3fd3f307e80195c7f13545ec5fbcff">WakeSomeone</a>(pq, message, pqmsgInput);</div>
<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>&#160;    }</div>
<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>&#160;}</div>
<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>&#160; </div>
<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>&#160; </div>
<div class="line"><a name="l01460"></a><span class="lineno"><a class="line" href="a00899.html#aa390599d2470a03b6b47b6a0529a600e"> 1460</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a0a3fd3f307e80195c7f13545ec5fbcff">WakeSomeone</a>(</div>
<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>&#160;{</div>
<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>&#160; </div>
<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>&#160;<span class="comment">     * Set the appropriate wakebits for this queue.</span></div>
<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>&#160;    ptiT = NULL;</div>
<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>&#160;    <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>&#160; </div>
<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>&#160;    <span class="keywordflow">case</span> WM_SYSCHAR:</div>
<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>&#160;    <span class="keywordflow">case</span> WM_CHAR:</div>
<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>&#160;        <span class="comment">/* Freelance graphics seems to pass in WM_SYSCHARs and WM_CHARs into</span></div>
<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>&#160;<span class="comment">         * the journal playback hook, so we need to set an input bit for</span></div>
<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>&#160;<span class="comment">         * this case since that is what win3.1 does. VB2 &quot;learning&quot; demo does</span></div>
<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>&#160;<span class="comment">         * the same, as does Excel intro.</span></div>
<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>&#160;<span class="comment">         * On win3.1, the WM_CHAR would by default set the QS_MOUSEBUTTON bit.</span></div>
<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>&#160;<span class="comment">         * On NT, the WM_CHAR sets the QS_KEY bit. This is because</span></div>
<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>&#160;<span class="comment">         * ScanSysQueue() calls TransferWakeBit() with the QS_KEY bit when</span></div>
<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>&#160;<span class="comment">         * a WM_CHAR message is passed in. By using the QS_KEY bit on NT,</span></div>
<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>&#160;<span class="comment">         * we&#39;re more compatible with what win3.1 wants to be.</span></div>
<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>&#160;<span class="comment">         * This fixes a case where the mouse was over progman, the WM_CHAR</span></div>
<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>&#160;<span class="comment">         * would come in via journal playback, wakesomeone would be called,</span></div>
<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>&#160;<span class="comment">         * and set the mouse bit in progman. Progman would then get into</span></div>
<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>&#160;<span class="comment">         * ScanSysQueue(), callback the journal playback hook, get the WM_CHAR,</span></div>
<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>&#160;<span class="comment">         * and do it again, looping. This caught VB2 in a loop.</span></div>
<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>&#160; </div>
<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>&#160;        <span class="comment">/* fall through */</span></div>
<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>&#160; </div>
<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>&#160;    <span class="keywordflow">case</span> WM_SYSKEYDOWN:</div>
<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>&#160;    <span class="keywordflow">case</span> WM_KEYDOWN:</div>
<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>&#160;        <a class="code" href="a03290.html#a155a894ac34924dc3551affcf39edd32">CancelForegroundActivate</a>();</div>
<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>&#160; </div>
<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>&#160;        <span class="comment">/* fall through */</span></div>
<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>&#160; </div>
<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>&#160;    <span class="keywordflow">case</span> WM_KEYUP:</div>
<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>&#160;    <span class="keywordflow">case</span> WM_SYSKEYUP:</div>
<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>&#160;    <span class="keywordflow">case</span> WM_MOUSEWHEEL:</div>
<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>&#160;<span class="comment">         * Win3.1 first looks at what thread has the active status. This</span></div>
<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>&#160;<span class="comment">         * means that we don&#39;t depend on the thread owning ptiKeyboard</span></div>
<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>&#160;<span class="comment">         * to wake up and process this key in order to give it to the</span></div>
<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>&#160;<span class="comment">         * active window, which is potentially newly active. Case in</span></div>
<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>&#160;<span class="comment">         * point: excel bringing up CBT, cbt has an error, brings up</span></div>
<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>&#160;<span class="comment">         * a message box: since excel is filtering for CBT messages only,</span></div>
<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>&#160;<span class="comment">         * ptiKeyboard never gets reassigned to CBT so CBT doesn&#39;t get</span></div>
<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>&#160;<span class="comment">         * any key messages and appears hung.</span></div>
<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>&#160;        ptiT = pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a>;</div>
<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>&#160;        <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> != NULL)</div>
<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>&#160;            ptiT = GETPTI(pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>);</div>
<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>&#160; </div>
<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiT, message == WM_MOUSEWHEEL ? QS_MOUSEBUTTON : QS_KEY);</div>
<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>&#160; </div>
<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>&#160;    <span class="keywordflow">case</span> WM_MOUSEMOVE:</div>
<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>&#160;<span class="comment">         * Make sure we wake up the thread with the capture, if there is</span></div>
<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>&#160;<span class="comment">         * one. This fixes PC Tools screen capture program, which sets</span></div>
<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>&#160;<span class="comment">         * capture and then loops trying to remove messages from the</span></div>
<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>&#160;<span class="comment">         * queue.</span></div>
<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>&#160;        <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a> != NULL)</div>
<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>&#160;            ptiT = GETPTI(pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>);</div>
<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>&#160;            ptiT = pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a>;</div>
<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiT, QS_MOUSEMOVE);</div>
<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>&#160; </div>
<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>&#160; </div>
<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>&#160;    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>&#160;<span class="comment">         * The default case in Win3.1 for this is QS_MOUSEBUTTON.</span></div>
<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>&#160; </div>
<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>&#160;        <span class="comment">/* fall through */</span></div>
<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>&#160; </div>
<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>&#160;    <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>&#160;    <span class="keywordflow">case</span> WM_LBUTTONDBLCLK:</div>
<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>&#160;    <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>&#160;    <span class="keywordflow">case</span> WM_RBUTTONDBLCLK:</div>
<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>&#160;    <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>&#160;    <span class="keywordflow">case</span> WM_MBUTTONDBLCLK:</div>
<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>&#160;        <a class="code" href="a03290.html#a155a894ac34924dc3551affcf39edd32">CancelForegroundActivate</a>();</div>
<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>&#160; </div>
<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>&#160;        <span class="comment">/* fall through */</span></div>
<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>&#160; </div>
<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>&#160;    <span class="keywordflow">case</span> WM_LBUTTONUP:</div>
<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>&#160;    <span class="keywordflow">case</span> WM_RBUTTONUP:</div>
<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>&#160;    <span class="keywordflow">case</span> WM_MBUTTONUP:</div>
<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>&#160;<span class="comment">         * Make sure we wake up the thread with the capture, if there is</span></div>
<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>&#160;<span class="comment">         * one. This fixes PC Tools screen capture program, which sets</span></div>
<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>&#160;<span class="comment">         * capture and then loops trying to remove messages from the</span></div>
<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>&#160;<span class="comment">         * queue.</span></div>
<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>&#160;        <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a> != NULL &amp;&amp;</div>
<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>&#160;                message &gt;= WM_MOUSEFIRST &amp;&amp; message &lt;= WM_MOUSELAST)</div>
<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>&#160;            ptiT = GETPTI(pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>);</div>
<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>&#160;            ptiT = pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a>;</div>
<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiT, QS_MOUSEBUTTON);</div>
<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>&#160;    }</div>
<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>&#160; </div>
<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>&#160;<span class="comment">     * If a messaged was passed in, remember in it who we woke up for this</span></div>
<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>&#160;<span class="comment">     * message. We do this so each message is ownership marked. This way</span></div>
<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>&#160;<span class="comment">     * we can merge/unmerge message streams when AttachThreadInput() is</span></div>
<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>&#160;<span class="comment">     * called.</span></div>
<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>&#160;    <span class="keywordflow">if</span> (ptiT != NULL &amp;&amp; pqmsg != NULL) {</div>
<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160;        pqmsg-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = ptiT;</div>
<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!(ptiT-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_INCLEANUP));</div>
<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>&#160;    }</div>
<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>&#160;}</div>
<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>&#160; </div>
<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>&#160; </div>
<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>&#160; </div>
<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>&#160;NTSTATUS</div>
<div class="line"><a name="l01594"></a><span class="lineno"><a class="line" href="a03290.html#a412e5db9753a1a73ff980b89cce66354"> 1594</a></span>&#160;<a class="code" href="a03290.html#a412e5db9753a1a73ff980b89cce66354">InitKeyStateLookaside</a>()</div>
<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>&#160;{</div>
<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>&#160;    ULONG BlockSize;</div>
<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>&#160;    ULONG InitialSegmentSize;</div>
<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>&#160; </div>
<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>&#160;    BlockSize = (<a class="code" href="a03290.html#a3c78db181c4cbc63a66159f9de7b0b22">KEYSTATESIZE</a> + 7) &amp; ~7;</div>
<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>&#160;    InitialSegmentSize = 8 * BlockSize + <span class="keyword">sizeof</span>(ZONE_SEGMENT_HEADER);</div>
<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>&#160; </div>
<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>&#160;    <a class="code" href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a> = UserAllocPool(InitialSegmentSize, TAG_LOOKASIDE);</div>
<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>&#160; </div>
<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>&#160;    <span class="keywordflow">if</span> ( !<a class="code" href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a> ) {</div>
<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>&#160;        <span class="keywordflow">return</span> STATUS_NO_MEMORY;</div>
<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>&#160;        }</div>
<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>&#160; </div>
<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>&#160;    <a class="code" href="a03290.html#ac43268187ecd11008c36d6e783bcf1f8">KeyStateLookasideBounds</a> = (PVOID)((PUCHAR)<a class="code" href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a> + InitialSegmentSize);</div>
<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>&#160; </div>
<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>&#160;    <span class="keywordflow">return</span> ExInitializeZone(&amp;<a class="code" href="a03290.html#a50cffbba16c3bea57405e8726eb4b682">KeyStateLookasideZone</a>,</div>
<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>&#160;                            BlockSize,</div>
<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>&#160;                            <a class="code" href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a>,</div>
<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>&#160;                            InitialSegmentSize);</div>
<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>&#160;}</div>
<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>&#160; </div>
<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>&#160; </div>
<div class="line"><a name="l01625"></a><span class="lineno"><a class="line" href="a03290.html#ac5221341dcd1cc2116f08477d5fe85f4"> 1625</a></span>&#160;PBYTE <a class="code" href="a03290.html#ac5221341dcd1cc2116f08477d5fe85f4">AllocKeyState</a>(</div>
<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>&#160;    VOID)</div>
<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>&#160;{</div>
<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>&#160;    PBYTE pKeyState;</div>
<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>&#160; </div>
<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>&#160;    <span class="comment">// Attempt to get a QMSG from the zone. If this fails, then</span></div>
<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>&#160;    <span class="comment">// LocalAlloc the QMSG</span></div>
<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>&#160; </div>
<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>&#160;    pKeyState = ExAllocateFromZone(&amp;<a class="code" href="a03290.html#a50cffbba16c3bea57405e8726eb4b682">KeyStateLookasideZone</a>);</div>
<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>&#160; </div>
<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>&#160;    <span class="keywordflow">if</span> ( !pKeyState ) {</div>
<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>&#160;<span class="comment">         * Allocate a Q message structure.</span></div>
<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>&#160;        AllocKeyStateSlowCalls++;</div>
<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>&#160;        <span class="keywordflow">if</span> ((pKeyState = (PBYTE)UserAllocPool(<a class="code" href="a03290.html#a3c78db181c4cbc63a66159f9de7b0b22">KEYSTATESIZE</a>, TAG_KBDSTATE)) == NULL)</div>
<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>&#160;        }</div>
<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>&#160;    AllocKeyStateCalls++;</div>
<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>&#160; </div>
<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>&#160;    <span class="keywordflow">if</span> (AllocKeyStateCalls-DelKeyStateCalls &gt; AllocKeyStateHiWater ) {</div>
<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>&#160;        AllocKeyStateHiWater = AllocKeyStateCalls-DelKeyStateCalls;</div>
<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>&#160;        }</div>
<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>&#160; </div>
<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>&#160;    <span class="keywordflow">return</span> pKeyState;</div>
<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>&#160;}</div>
<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>&#160; </div>
<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>&#160; </div>
<div class="line"><a name="l01666"></a><span class="lineno"><a class="line" href="a03290.html#a0dee150599c13a9794347efe8e435f6f"> 1666</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a>(</div>
<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>&#160;    PBYTE pKeyState)</div>
<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>&#160;{</div>
<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>&#160;    DelKeyStateCalls++;</div>
<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>&#160; </div>
<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>&#160;    <span class="comment">// If the pKeyState was from zone, then free to zone</span></div>
<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>&#160;    <span class="keywordflow">if</span> ( (PVOID)pKeyState &gt;= <a class="code" href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a> &amp;&amp; (PVOID)pKeyState &lt; <a class="code" href="a03290.html#ac43268187ecd11008c36d6e783bcf1f8">KeyStateLookasideBounds</a> ) {</div>
<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>&#160;        ExFreeToZone(&amp;<a class="code" href="a03290.html#a50cffbba16c3bea57405e8726eb4b682">KeyStateLookasideZone</a>, pKeyState);</div>
<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>&#160;        DelKeyStateSlowCalls++;</div>
<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>&#160;        UserFreePool(pKeyState);</div>
<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>&#160;    }</div>
<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>&#160;}</div>
<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>&#160; </div>
<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>&#160; </div>
<div class="line"><a name="l01728"></a><span class="lineno"><a class="line" href="a00899.html#a3c7a65a04f65f7c71626a1cca090a475"> 1728</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a3c7a65a04f65f7c71626a1cca090a475">PostUpdateKeyStateEvent</a>(</div>
<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq)</div>
<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>&#160;{</div>
<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>&#160;    BYTE *pb;</div>
<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>&#160; </div>
<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>&#160;    <span class="keywordflow">if</span> (!(pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_UPDATEKEYSTATE))</div>
<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>&#160; </div>
<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>&#160;<span class="comment">     * Exclude the RIT - it&#39;s queue is never read, so don&#39;t waste memory</span></div>
<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> == <a class="code" href="a03257.html#a15b01bf3bf02ba131160e26e97f4abf5">gptiRit</a>) {</div>
<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>&#160;    }</div>
<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>&#160; </div>
<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> != NULL) {</div>
<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>&#160;        <span class="keywordtype">int</span> i;</div>
<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>&#160;        <a class="code" href="a02857.html">PQMSG</a> pqmsg = pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>;</div>
<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>&#160;        <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> *pdw;</div>
<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>&#160; </div>
<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>&#160;<span class="comment">         * If the last input message is an UPDATEKEYSTATE event, merge</span></div>
<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>&#160;        <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a> == QEVENT_UPDATEKEYSTATE) {</div>
<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>&#160; </div>
<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>&#160;            pb = (PBYTE)(pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>&#160;            pdw = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> *) (pb + CBKEYSTATE);</div>
<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>&#160; </div>
<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>&#160;<span class="comment">             * Copy in the new key state</span></div>
<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>&#160;            RtlCopyMemory(pb, <a class="code" href="a03257.html#a400c45d213332277ff223c8c26996f88">gafAsyncKeyState</a>, CBKEYSTATE);</div>
<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>&#160; </div>
<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>&#160;<span class="comment">             * Or in the recent key down state (DWORD at a time)</span></div>
<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>&#160;<span class="preprocessor">#if (CBKEYSTATERECENTDOWN % 4) != 0</span></div>
<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>&#160;<span class="preprocessor">#error &quot;CBKEYSTATERECENTDOWN assumed to be an integral number of DWORDs&quot;</span></div>
<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>&#160;            <span class="keywordflow">for</span> (i = 0; i &lt; CBKEYSTATERECENTDOWN / <span class="keyword">sizeof</span>(*pdw); i++) {</div>
<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>&#160;                *pdw++ |= ((<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> *)(pq-&gt;<a class="code" href="a02869.html#a875fdfc42780d6ae1b2d7df4402afae1">afKeyRecentDown</a>))[i];</div>
<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>&#160;            }</div>
<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>&#160; </div>
<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>&#160;<span class="comment">             * Set QS_EVENTSET as in PostEventMessage, although this is</span></div>
<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>&#160;<span class="comment">             * usually, but not always already set</span></div>
<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>&#160;            <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a>, QS_EVENTSET);</div>
<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>&#160;            <span class="keywordflow">goto</span> SyncQueue;</div>
<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>&#160;        }</div>
<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>&#160;    }</div>
<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>&#160; </div>
<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>&#160;<span class="comment">     * Make a copy of the async key state buffer, point to it, and add an</span></div>
<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>&#160;<span class="comment">     * event to the end of the input queue.</span></div>
<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>&#160;    <span class="keywordflow">if</span> ((pb = <a class="code" href="a03290.html#ac5221341dcd1cc2116f08477d5fe85f4">AllocKeyState</a>()) == NULL) {</div>
<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>&#160;    }</div>
<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>&#160; </div>
<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>&#160;    RtlCopyMemory(pb, <a class="code" href="a03257.html#a400c45d213332277ff223c8c26996f88">gafAsyncKeyState</a>, CBKEYSTATE);</div>
<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>&#160;    RtlCopyMemory(pb + CBKEYSTATE, pq-&gt;<a class="code" href="a02869.html#a875fdfc42780d6ae1b2d7df4402afae1">afKeyRecentDown</a>, CBKEYSTATERECENTDOWN);</div>
<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>&#160; </div>
<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="a03290.html#aa573471dabf238131312c12fb896b945">PostEventMessage</a>(pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a>, pq, QEVENT_UPDATEKEYSTATE,</div>
<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>&#160;                          NULL, 0 , (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pb, 0)) {</div>
<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>&#160;        <a class="code" href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a>(pb);</div>
<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>&#160;    }</div>
<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>&#160; </div>
<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>&#160;<span class="comment">     * The key state of the queue is input-synchronized with the user.  Erase</span></div>
<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>&#160;<span class="comment">     * all &#39;recent down&#39; flags.</span></div>
<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>&#160;SyncQueue:</div>
<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>&#160;    RtlZeroMemory(pq-&gt;<a class="code" href="a02869.html#a875fdfc42780d6ae1b2d7df4402afae1">afKeyRecentDown</a>, CBKEYSTATERECENTDOWN);</div>
<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_UPDATEKEYSTATE;</div>
<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>&#160;}</div>
<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>&#160; </div>
<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>&#160; </div>
<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>&#160; </div>
<div class="line"><a name="l01816"></a><span class="lineno"><a class="line" href="a00824.html#a625f273e3c887a8cf38f78db6d144bca"> 1816</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a625f273e3c887a8cf38f78db6d144bca">ProcessUpdateKeyStateEvent</a>(</div>
<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>&#160;    PBYTE pbKeyState)</div>
<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>&#160;{</div>
<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>&#160;    <span class="keywordtype">int</span> i, j;</div>
<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>&#160;    BYTE *pbChange;</div>
<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>&#160;    BYTE *pbRecentDown;</div>
<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>&#160;    <span class="keywordtype">int</span> vk, vkSwap;</div>
<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>&#160; </div>
<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>&#160;    pbRecentDown = pbChange = pbKeyState + CBKEYSTATE;</div>
<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; CBKEYSTATERECENTDOWN; i++, pbChange++) {</div>
<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>&#160; </div>
<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>&#160;<span class="comment">         * Find some keys that have changed.</span></div>
<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>&#160;        <span class="keywordflow">if</span> (*pbChange == 0)</div>
<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>&#160; </div>
<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>&#160;<span class="comment">         * Some keys have changed in this byte.  find out which key it is.</span></div>
<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>&#160;        <span class="keywordflow">for</span> (j = 0; j &lt; 8; j++) {</div>
<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>&#160; </div>
<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>&#160;<span class="comment">             * Convert our counts to a virtual key index and check to see</span></div>
<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>&#160;<span class="comment">             * if this key has changed.</span></div>
<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>&#160;            vkSwap = vk = (i &lt;&lt; 3) + j;</div>
<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>&#160;            <span class="keywordflow">if</span> (!TestKeyRecentDownBit(pbRecentDown, vk))</div>
<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>&#160; </div>
<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>&#160;<span class="comment">             * This key has changed.  Update it&#39;s state in the thread key</span></div>
<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>&#160;<span class="comment">             * state table.</span></div>
<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>&#160;<span class="comment">             * Swap the mouse buttons if necessary: The AsyncKeyState contains</span></div>
<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>&#160;<span class="comment">             * physical (unswapped) mouse VKs, but the queue&#39;s synch key state</span></div>
<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>&#160;<span class="comment">             * needs the swapped mouse VKs (if fSwapButtons)</span></div>
<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(VK_LBUTTON == 1 &amp;&amp; VK_RBUTTON == 2);</div>
<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>&#160;            <span class="keywordflow">if</span> ((vk &lt;= VK_RBUTTON) &amp;&amp; (vk &gt;= VK_LBUTTON) &amp;&amp; SYSMET(SWAPBUTTON)){</div>
<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>&#160;                vkSwap ^= 3;    <span class="comment">// Use XOR to swap buttons</span></div>
<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>&#160;            }</div>
<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>&#160; </div>
<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>&#160;            <span class="keywordflow">if</span> (TestKeyDownBit(pbKeyState, vk)) {</div>
<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>&#160;                SetKeyStateDown(pq, vkSwap);</div>
<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>&#160;                ClearKeyStateDown(pq, vkSwap);</div>
<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>&#160;            }</div>
<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>&#160; </div>
<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>&#160;            <span class="keywordflow">if</span> (TestKeyToggleBit(pbKeyState, vk)) {</div>
<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>&#160;                SetKeyStateToggle(pq, vkSwap);</div>
<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>&#160;                ClearKeyStateToggle(pq, vkSwap);</div>
<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>&#160;            }</div>
<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>&#160;        }</div>
<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>&#160;    }</div>
<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>&#160; </div>
<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>&#160;<span class="comment">     * Update the key cache index.</span></div>
<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>&#160;    <a class="code" href="a00020.html#ad760da1dd81d9e84dee607d18edfde39">gpsi</a>-&gt;<a class="code" href="a02513.html#a125933441b95aca04386827b052dfe42">dwKeyCache</a>++;</div>
<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>&#160; </div>
<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>&#160;<span class="comment">     * All updated.  Free the key state table.</span></div>
<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>&#160;    <a class="code" href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a>(pbKeyState);</div>
<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>&#160;}</div>
<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>&#160; </div>
<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>&#160; </div>
<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>&#160; </div>
<div class="line"><a name="l01893"></a><span class="lineno"><a class="line" href="a00899.html#aa573471dabf238131312c12fb896b945"> 1893</a></span>&#160;BOOL <a class="code" href="a03290.html#aa573471dabf238131312c12fb896b945">PostEventMessage</a>(</div>
<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwQEvent,</div>
<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> wParam,</div>
<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>&#160;    LONG lParam)</div>
<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>&#160;{</div>
<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgEvent;</div>
<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>&#160; </div>
<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>&#160; </div>
<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>&#160;    <span class="keywordflow">if</span> ((pqmsgEvent = <a class="code" href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>)) == NULL)</div>
<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>&#160; </div>
<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>&#160;    <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(pqmsgEvent, pwnd, message, wParam, lParam, dwQEvent, 0);</div>
<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>&#160;    pqmsgEvent-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = pti;</div>
<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>&#160; </div>
<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>&#160;<span class="comment">     * If the thread is in cleanup, then it&#39;s possible the queue has</span></div>
<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>&#160;<span class="comment">     * already been removed for this thread.  If this is the case, then</span></div>
<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>&#160;<span class="comment">     * we should fail to post the event to a dying thread.</span></div>
<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>&#160;    <span class="keywordflow">if</span> (pti &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_INCLEANUP))</div>
<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>&#160; </div>
<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>&#160;<span class="comment">     * Let this thread know it has an event message to process.</span></div>
<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>&#160;    <span class="keywordflow">if</span> (pti == NULL) {</div>
<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti);</div>
<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a>, QS_EVENTSET);</div>
<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a>, QS_EVENTSET);</div>
<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>&#160;        <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_EVENTSET);</div>
<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>&#160;    }</div>
<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>&#160; </div>
<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>&#160;}</div>
<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>&#160; </div>
<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>&#160; </div>
<div class="line"><a name="l01972"></a><span class="lineno"><a class="line" href="a03290.html#a68ac12a88a920588a518cd2dcc3a16c4"> 1972</a></span>&#160;BOOL <a class="code" href="a03290.html#a68ac12a88a920588a518cd2dcc3a16c4">CheckOnTop</a>(<a class="code" href="a02889.html">PTHREADINFO</a> pti, <a class="code" href="a02581.html">PWND</a> pwndTop, <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message)</div>
<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>&#160;{</div>
<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>&#160;    <span class="keywordflow">if</span> (pwndTop != pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>)</div>
<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>&#160; </div>
<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>&#160;    <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>&#160;        <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>&#160;        <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>&#160;        <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>&#160;            <span class="keywordflow">if</span> (   TestWF(pwndTop, WEFTOPMOST)</div>
<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>&#160;                    || (<a class="code" href="a00365.html#a976181f00e2ce3d0df4b770ea93f8443">_GetWindow</a>(pwndTop, GW_HWNDPREV) != <a class="code" href="a00872.html#a641f4e16c75a445b125667f001e07535">CalcForegroundInsertAfter</a>(pwndTop))) {</div>
<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>&#160; </div>
<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>&#160;                 <span class="keywordflow">return</span> <a class="code" href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a>(pwndTop, PWND_TOP, 0, 0, 0, 0,</div>
<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>&#160;                        SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);</div>
<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>&#160;             }</div>
<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>&#160;             <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>&#160;    }</div>
<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>&#160; </div>
<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>&#160;}</div>
<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>&#160; </div>
<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>&#160; </div>
<div class="line"><a name="l01994"></a><span class="lineno"><a class="line" href="a03290.html#a965b7101a952d947aed195405703c0d6"> 1994</a></span>&#160;<span class="preprocessor">#define MA_PASSTHRU     0</span></div>
<div class="line"><a name="l01995"></a><span class="lineno"><a class="line" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82"> 1995</a></span>&#160;<span class="preprocessor">#define MA_SKIP         1</span></div>
<div class="line"><a name="l01996"></a><span class="lineno"><a class="line" href="a03290.html#a88031672cdc9e5f4f92f03caf1f65c81"> 1996</a></span>&#160;<span class="preprocessor">#define MA_REHITTEST    2</span></div>
<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>&#160; </div>
<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>&#160; </div>
<div class="line"><a name="l02005"></a><span class="lineno"><a class="line" href="a00899.html#a4147dbf43a1943171ea44ffbb52c791d"> 2005</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03290.html#a4147dbf43a1943171ea44ffbb52c791d">xxxActiveWindowTracking</a>(</div>
<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> uMsg,</div>
<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>&#160;    <span class="keywordtype">int</span> iHitTest)</div>
<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>&#160;{</div>
<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>&#160;    <span class="keyword">static</span> POINT gptLastTrack = {0, 0};</div>
<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>&#160; </div>
<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>&#160;    BOOL fSuccess;</div>
<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndActivate;</div>
<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndActivate;</div>
<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>&#160;    <span class="keywordtype">int</span> iRet;</div>
<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>&#160;    <a class="code" href="a02869.html">Q</a> *pq;</div>
<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>&#160; </div>
<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>&#160;    <a class="code" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a>(pwnd);</div>
<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(SPI_UP(ACTIVEWINDOWTRACKING));</div>
<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>&#160; </div>
<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>&#160;<span class="comment">     * Some times we fake mouse moves to let apps know where the</span></div>
<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>&#160;<span class="comment">     *  mouse is or to force them to wake up.</span></div>
<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>&#160;<span class="comment">     * We don&#39;t have a way to detect these so here is my hack</span></div>
<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>&#160;<span class="comment">     *  to ignore them.</span></div>
<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>&#160;<span class="comment">     * This is to prevent activation from returning to the window</span></div>
<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>&#160;<span class="comment">     *  the mouse is on after a window has been activated using</span></div>
<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>&#160;<span class="comment">     *  the keyboard (alt-tab or ctrl-esc-run; xxxCapture calls</span></div>
<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>&#160;<span class="comment">     *  SetFMouseMoved).</span></div>
<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>&#160;<span class="comment">     * LATER: GerardoB</span></div>
<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>&#160;<span class="comment">     * Note that as soon as you move the mouse, then activation</span></div>
<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>&#160;<span class="comment">     *  will change anyway. In the future, we could add a</span></div>
<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>&#160;<span class="comment">     *  snap-mouse-to-foreground-queue (or active window) option</span></div>
<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>&#160;<span class="comment">     *  so we&#39;ll move the mouse into the window activated by the</span></div>
<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>&#160;<span class="comment">     *  keyboard.</span></div>
<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>&#160;    <span class="keywordflow">if</span> ((ptCursor.x == gptLastTrack.x) &amp;&amp; (ptCursor.y == gptLastTrack.y)) {</div>
<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>&#160;    }</div>
<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>&#160;    gptLastTrack = ptCursor;</div>
<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>&#160; </div>
<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>&#160;<span class="comment">     * If someone is in menu mode, bail</span></div>
<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00899.html#aadce81eb182c2355be276b7a450d8101">IsSomeOneInMenuMode</a>()) {</div>
<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>&#160;    }</div>
<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>&#160; </div>
<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>&#160;    pwndActivate = pwnd;</div>
<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>&#160; </div>
<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>&#160;<span class="comment">     * Find the top parent</span></div>
<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>&#160;    <span class="keywordflow">while</span> (TestwndChild(pwndActivate)) {</div>
<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>&#160;        pwndActivate = pwndActivate-&gt;<a class="code" href="a02581.html#a6053af0b243b6737640988eb63081de3">spwndParent</a>;</div>
<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>&#160;    }</div>
<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>&#160; </div>
<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>&#160;<span class="comment">     * If disabled, get a enabled popup owned by it.</span></div>
<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>&#160;<span class="comment">     * This test is the same as calling FBadWindow (05/31/96)</span></div>
<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>&#160;<span class="comment">     *  because we already know it&#39;s not NULL and it must</span></div>
<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>&#160;<span class="comment">     *  be visible (the mouse is on it)</span></div>
<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(TestWF(pwndActivate, WFVISIBLE));</div>
<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>&#160;    <span class="keywordflow">if</span> (TestWF(pwndActivate, WFDISABLED)) {</div>
<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>&#160;<span class="comment">         * This is what we do elsewhere when someone clicks on a</span></div>
<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>&#160;<span class="comment">         *  disabled non-active window. It might be cheaper to check</span></div>
<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>&#160;<span class="comment">         *  pwnd-&gt;spwndLastActive first (we might need to walk up</span></div>
<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>&#160;<span class="comment">         *  the owner chain though, as this is where we set spwndLastAcitve</span></div>
<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>&#160;<span class="comment">         *  when activating a new window. see xxxActivateThisWindow).</span></div>
<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>&#160;<span class="comment">         * But let&#39;s do the same here; this should be fixed/improved</span></div>
<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>&#160;<span class="comment">         *  in DWP_GetEnabledPopup anyway. There might be a reason</span></div>
<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>&#160;<span class="comment">         *  why we don&#39;t grab spwndLastActive if OK.... perhaps it has</span></div>
<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>&#160;<span class="comment">         *  something to do with nested owner windows</span></div>
<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>&#160;         pwndActivate = <a class="code" href="a00671.html#a269a5b2fe3144f017cd9f9530cc56409">DWP_GetEnabledPopup</a>(pwndActivate);</div>
<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>&#160;    }</div>
<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>&#160; </div>
<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>&#160;<span class="comment">     * Bail if we didn&#39;t find one</span></div>
<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>&#160;    <span class="keywordflow">if</span> (pwndActivate == NULL) {</div>
<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>&#160;    }</div>
<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>&#160; </div>
<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>&#160;<span class="comment">     * If already active in the foreground queue, nothing to do</span></div>
<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>&#160;    pq = GETPTI(pwndActivate)-&gt;pq;</div>
<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>&#160;    <span class="keywordflow">if</span> ((pq == <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>) &amp;&amp; (pwndActivate == pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>)) {</div>
<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>&#160;    }</div>
<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>&#160; </div>
<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>&#160;<span class="comment">     * Don&#39;t activate the desktop</span></div>
<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>&#160;    <span class="keywordflow">if</span> (pwndActivate == PWNDDESKTOP(pwndActivate)) {</div>
<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>&#160;    }</div>
<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>&#160; </div>
<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>&#160;<span class="comment">     * We&#39;re going to callback, so lock if needed</span></div>
<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>&#160;    <span class="keywordflow">if</span> (pwnd != pwndActivate) {</div>
<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>&#160;        ThreadLockAlways(pwndActivate, &amp;tlpwndActivate);</div>
<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>&#160;    }</div>
<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>&#160; </div>
<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>&#160; </div>
<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>&#160;<span class="comment">     * Let&#39;s ask if it&#39;s OK to do this</span></div>
<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>&#160;    iRet = (int)<a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwnd, WM_MOUSEACTIVATE,</div>
<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>&#160;            (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)(HW(pwndActivate)), MAKELONG((SHORT)iHitTest, uMsg));</div>
<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>&#160; </div>
<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>&#160; </div>
<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>&#160;    <span class="keywordflow">switch</span> (iRet) {</div>
<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>&#160;        <span class="keywordflow">case</span> MA_ACTIVATE:</div>
<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>&#160;        <span class="keywordflow">case</span> MA_ACTIVATEANDEAT:</div>
<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>&#160;<span class="comment">             * Activate the window without bring it to the top.</span></div>
<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>&#160;<span class="comment">             * LATER: GerardoB</span></div>
<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>&#160;<span class="comment">             * What about an option that would do the window tracking</span></div>
<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>&#160;<span class="comment">             *  bringing the window to the top? As easy as not passing</span></div>
<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>&#160;<span class="comment">             *  the *_NOZORDER flag  (I guess...)</span></div>
<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>&#160;            <span class="keywordflow">if</span> (pq == <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>) {</div>
<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>&#160;                fSuccess = <a class="code" href="a00686.html#a1dc7b5d2bcb53d6272a655ff64427cb3">xxxActivateThisWindow</a>(pwndActivate, 0, ATW_NOZORDER);</div>
<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>&#160;                fSuccess = <a class="code" href="a00686.html#a16558717257c16a685cc2eaf97a67ad3">xxxSetForegroundWindow2</a>(pwndActivate, NULL, SFW_SWITCH | SFW_NOZORDER);</div>
<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>&#160;            }</div>
<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>&#160; </div>
<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>&#160;<span class="comment">             * Eat the message if activation failed.</span></div>
<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>&#160;            <span class="keywordflow">if</span> (!fSuccess) {</div>
<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>&#160;                iRet = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRet == MA_ACTIVATEANDEAT) {</div>
<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>&#160;               iRet = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>&#160;            }</div>
<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>&#160; </div>
<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>&#160;        <span class="keywordflow">case</span> MA_NOACTIVATEANDEAT:</div>
<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>&#160;            iRet = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>&#160; </div>
<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>&#160; </div>
<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>&#160;        <span class="keywordflow">case</span> MA_NOACTIVATE:</div>
<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>&#160;        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>&#160;            iRet = <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>&#160;    }</div>
<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>&#160; </div>
<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>&#160;    <span class="keywordflow">if</span> (pwnd != pwndActivate) {</div>
<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>&#160;        ThreadUnlock(&amp;tlpwndActivate);</div>
<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>&#160;    }</div>
<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>&#160; </div>
<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>&#160;    <span class="keywordflow">return</span> iRet;</div>
<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>&#160; </div>
<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>&#160;}</div>
<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>&#160; </div>
<div class="line"><a name="l02179"></a><span class="lineno"><a class="line" href="a00899.html#a8e55eab39af5bc9e6f4bf22b243cda82"> 2179</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03290.html#a8e55eab39af5bc9e6f4bf22b243cda82">xxxMouseActivate</a>(</div>
<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>&#160;    LPPOINT lppt,</div>
<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>&#160;    <span class="keywordtype">int</span> ht)</div>
<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>&#160;{</div>
<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> x, y;</div>
<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndTop;</div>
<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>&#160;    <span class="keywordtype">int</span> result;</div>
<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndTop;</div>
<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>&#160;    BOOL fSend;</div>
<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>&#160; </div>
<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>&#160;    <a class="code" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a>(pwnd);</div>
<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>&#160; </div>
<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>&#160;<span class="comment">     * No mouse activation if the mouse is captured. Must check for the capture</span></div>
<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>&#160;<span class="comment">     * ONLY here. 123W depends on it - create a graph, select Rearrange..</span></div>
<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>&#160;<span class="comment">     * flip horizontal, click outside the graph. If this code checks for</span></div>
<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>&#160;<span class="comment">     * anything beside just capture, 123w will get the below messages and</span></div>
<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>&#160;<span class="comment">     * get confused.</span></div>
<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a> != NULL) {</div>
<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>&#160;    }</div>
<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>&#160; </div>
<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>&#160;    result = <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>&#160; </div>
<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>&#160;    pwndTop = pwnd;</div>
<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>&#160;    ThreadLockWithPti(pti, pwndTop, &amp;tlpwndTop);</div>
<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>&#160; </div>
<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>&#160;<span class="comment">         * B#1404</span></div>
<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>&#160;<span class="comment">         * Don&#39;t send WM_PARENTNOTIFY messages if the child has</span></div>
<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>&#160;<span class="comment">         * WS_EX_NOPARENTNOTIFY style.</span></div>
<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>&#160;<span class="comment">         * Unfortunately, this breaks people who create controls in</span></div>
<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>&#160;<span class="comment">         * MDI children, like WinMail.  They don&#39;t get WM_PARENTNOTIFY</span></div>
<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>&#160;<span class="comment">         * messages, which don&#39;t get passed to DefMDIChildProc(), which</span></div>
<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>&#160;<span class="comment">         * then can&#39;t update the active MDI child.  Grrr.</span></div>
<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>&#160; </div>
<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>&#160;    fSend = (!TestWF(pwnd, WFWIN40COMPAT) || !TestWF(pwnd, WEFNOPARENTNOTIFY));</div>
<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>&#160; </div>
<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>&#160;<span class="comment">     * If it&#39;s a buttondown event, send WM_PARENTNOTIFY.</span></div>
<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>&#160;    <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>&#160;    <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>&#160;    <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>&#160;    <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>&#160;        <span class="keywordflow">while</span> (TestwndChild(pwndTop)) {</div>
<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>&#160;            pwndTop = pwndTop-&gt;<a class="code" href="a02581.html#a6053af0b243b6737640988eb63081de3">spwndParent</a>;</div>
<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>&#160; </div>
<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>&#160;            <span class="keywordflow">if</span> (fSend) {</div>
<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>&#160;                ThreadUnlock(&amp;tlpwndTop);</div>
<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>&#160;                ThreadLockWithPti(pti, pwndTop, &amp;tlpwndTop);</div>
<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>&#160;                x = (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)(lppt-&gt;x - pwndTop-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.left);</div>
<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>&#160;                y = (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)(lppt-&gt;y - pwndTop-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.top);</div>
<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>&#160;                <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndTop, WM_PARENTNOTIFY, message, MAKELONG(x, y));</div>
<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>&#160;            }</div>
<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>&#160;        }</div>
<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>&#160; </div>
<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>&#160;        <span class="keywordflow">if</span> (!fSend) {</div>
<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>&#160;            ThreadUnlock(&amp;tlpwndTop);</div>
<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>&#160;            ThreadLockAlwaysWithPti(pti, pwndTop, &amp;tlpwndTop);</div>
<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>&#160;        }</div>
<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>&#160; </div>
<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>&#160;<span class="comment">         * NOTE: We break out of this loop with pwndTop locked.</span></div>
<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>&#160;    }</div>
<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>&#160; </div>
<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>&#160;<span class="comment">     * The mouse was moved onto this window: make it foreground</span></div>
<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>&#160;    <span class="keywordflow">if</span> (SPI_UP(ACTIVEWINDOWTRACKING) &amp;&amp; (message == WM_MOUSEMOVE)) {</div>
<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span>&#160;        result = <a class="code" href="a03290.html#a4147dbf43a1943171ea44ffbb52c791d">xxxActiveWindowTracking</a>(pwnd, WM_MOUSEMOVE, ht);</div>
<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>&#160;    }</div>
<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>&#160; </div>
<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>&#160;<span class="comment">     * Are we hitting an inactive top-level window WHICH ISN&#39;T THE DESKTOP(!)?</span></div>
<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>&#160;<span class="comment">     * craigc 7-14-89 hitting either inactive top level or any child window,</span></div>
<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>&#160;<span class="comment">     * to be compatible with 2.X.  Apps apparently needs this message.</span></div>
<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> != pwnd || pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_EVENTDEACTIVATEREMOVED) &amp;&amp;</div>
<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>&#160;            (pwndTop != PWNDDESKTOP(pwndTop))) {</div>
<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>&#160;        <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>&#160;        <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>&#160;        <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>&#160;        <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>&#160; </div>
<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>&#160;<span class="comment">             * Send the MOUSEACTIVATE message.</span></div>
<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>&#160;            result = (int)<a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwnd, WM_MOUSEACTIVATE,</div>
<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>&#160;                    (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)(HW(pwndTop)), MAKELONG((SHORT)ht, message));</div>
<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>&#160; </div>
<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>&#160;            <span class="keywordflow">switch</span> (result) {</div>
<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>&#160; </div>
<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>&#160;            <span class="keywordflow">case</span> 0:</div>
<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span>&#160;            <span class="keywordflow">case</span> MA_ACTIVATE:</div>
<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>&#160;            <span class="keywordflow">case</span> MA_ACTIVATEANDEAT:</div>
<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>&#160; </div>
<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span>&#160;<span class="comment">                 * If activation fails, swallow the message.</span></div>
<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>&#160;                <span class="keywordflow">if</span> ((pwndTop != pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> ||</div>
<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span>&#160;                        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_EVENTDEACTIVATEREMOVED) &amp;&amp;</div>
<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>&#160;                        !<a class="code" href="a00686.html#ae73d0cb06f257cf26e31b93dd71029ef">xxxActivateWindow</a>(pwndTop,</div>
<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>&#160;                          (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)((pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> == NO_CAP_CLIENT) ?</div>
<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>&#160;                          AW_TRY2 : AW_TRY))) {</div>
<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>&#160;                    result = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (TestWF(pwndTop, WFDISABLED)) {</div>
<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>&#160;<span class="preprocessor">#ifdef NEVER</span></div>
<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>&#160; </div>
<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>&#160;<span class="comment">                     * Althoug this is what win3 does, it is braindead: it</span></div>
<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>&#160;<span class="comment">                     * can easily cause infinite loops.  Returning &quot;rehittest&quot;</span></div>
<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>&#160;<span class="comment">                     * means process this event over again - nothing causes</span></div>
<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>&#160;<span class="comment">                     * anything different to happen, and we get an infinite</span></div>
<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>&#160;<span class="comment">                     * loop.  This case never gets executed on win3 because if</span></div>
<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>&#160;<span class="comment">                     * the window is disabled, it got the HTERROR hittest</span></div>
<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>&#160;<span class="comment">                     * code.  This can only be done on Win32 where input is</span></div>
<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>&#160;<span class="comment">                     * assigned to a window BEFORE process occurs to pull</span></div>
<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>&#160;<span class="comment">                     * it out of the queue.</span></div>
<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>&#160;                    result = <a class="code" href="a03290.html#a88031672cdc9e5f4f92f03caf1f65c81">MA_REHITTEST</a>;</div>
<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>&#160; </div>
<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>&#160;<span class="comment">                     * Someone clicked on a window before it was disabled...</span></div>
<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>&#160;<span class="comment">                     * Since it is disabled now, don&#39;t send this message to</span></div>
<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>&#160;<span class="comment">                     * it: instead eat it.</span></div>
<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span>&#160;                    result = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (result == MA_ACTIVATEANDEAT) {</div>
<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>&#160;                    result = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>&#160;                    result = <a class="code" href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a>;</div>
<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>&#160;                    <span class="keywordflow">goto</span> ItsActiveJustCheckOnTop;</div>
<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>&#160;                }</div>
<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>&#160; </div>
<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>&#160;            <span class="keywordflow">case</span> MA_NOACTIVATEANDEAT:</div>
<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>&#160;                result = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>&#160;            }</div>
<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>&#160;        }</div>
<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>&#160;ItsActiveJustCheckOnTop:</div>
<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>&#160;<span class="comment">         * Make sure this active window is on top (see comment</span></div>
<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>&#160;<span class="comment">         * in CheckOnTop).</span></div>
<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>&#160;        <span class="keywordflow">if</span> (SPI_UP(ACTIVEWINDOWTRACKING)) {</div>
<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03290.html#a68ac12a88a920588a518cd2dcc3a16c4">CheckOnTop</a>(pti, pwndTop, message)) {</div>
<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>&#160;<span class="comment">                 * The window was z-ordered to the top.</span></div>
<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>&#160;<span class="comment">                 * If it is a console window, skip the message</span></div>
<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span>&#160;<span class="comment">                 *  so it won&#39;t go into &quot;selecting&quot; mode</span></div>
<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>&#160;<span class="comment">                 * Hard error boxes are created by csrss as well</span></div>
<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>&#160;<span class="comment">                 * If we have topmost console windows someday, this</span></div>
<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>&#160;<span class="comment">                 *  will need to change</span></div>
<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>&#160;                 <span class="keywordflow">if</span> ((GETPTI(pwndTop)-&gt;TIF_flags &amp; TIF_CSRSSTHREAD)</div>
<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>&#160;                        &amp;&amp; !(TestWF(pwndTop, WEFTOPMOST))) {</div>
<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>&#160; </div>
<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>&#160;                     <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;xxxMouseActivate: Skipping msg %#lx for pwnd %#lx&quot;</span>,</div>
<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>&#160;                            message, pwndTop);</div>
<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>&#160;                     result = <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>;</div>
<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>&#160;                 }</div>
<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>&#160;            }</div>
<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>&#160;        } <span class="comment">/* if (gbActiveWindowTracking) */</span></div>
<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>&#160;    }</div>
<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>&#160; </div>
<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>&#160;<span class="comment">     * Now set the cursor shape.</span></div>
<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a> == NULL) {</div>
<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span>&#160;        <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwnd, WM_SETCURSOR, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)HW(pwnd),</div>
<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>&#160;                MAKELONG((SHORT)ht, message));</div>
<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>&#160;    }</div>
<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>&#160; </div>
<div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>&#160;    ThreadUnlock(&amp;tlpwndTop);</div>
<div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>&#160;    <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l02367"></a><span class="lineno"> 2367</span>&#160;}</div>
<div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>&#160; </div>
<div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>&#160; </div>
<div class="line"><a name="l02377"></a><span class="lineno"><a class="line" href="a03290.html#ac2ac12bbb64bf174d45df0e65d717f84"> 2377</a></span>&#160;LONG <a class="code" href="a03290.html#ac2ac12bbb64bf174d45df0e65d717f84">xxxMouseHoverTimer</a>(</div>
<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msg,</div>
<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <span class="keywordtype">id</span>,</div>
<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>&#160;    LONG lParam)</div>
<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>&#160;{</div>
<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>&#160;    POINT pt;</div>
<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>&#160;    <span class="keywordtype">int</span> part;</div>
<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wParam;</div>
<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>&#160;    HWND hwnd;</div>
<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndDesktop = <a class="code" href="a03743.html#a6fff890dabd74b268fbcba3368ecc560">_GetDesktopWindow</a>();</div>
<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span>&#160; </div>
<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; (QF_TRACKMOUSEHOVER | QF_TRACKMOUSEFIRING) != QF_TRACKMOUSEHOVER) {</div>
<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>&#160;    }</div>
<div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>&#160; </div>
<div class="line"><a name="l02394"></a><span class="lineno"> 2394</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a> != pwnd) {</div>
<div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l02396"></a><span class="lineno"> 2396</span>&#160;    }</div>
<div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>&#160; </div>
<div class="line"><a name="l02398"></a><span class="lineno"> 2398</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02399"></a><span class="lineno"> 2399</span>&#160;<span class="comment">     * remember that we&#39;re processing the timer</span></div>
<div class="line"><a name="l02400"></a><span class="lineno"> 2400</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02401"></a><span class="lineno"> 2401</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_TRACKMOUSEFIRING;</div>
<div class="line"><a name="l02402"></a><span class="lineno"> 2402</span>&#160; </div>
<div class="line"><a name="l02403"></a><span class="lineno"> 2403</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>&#160;<span class="comment">     * hit test the current mouse position to verify our hover.</span></div>
<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>&#160;    pt = FJOURNALPLAYBACK() ? GETPTI(pwnd)-&gt;ptLast : ptCursor;</div>
<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>&#160;    part = HTCLIENT;        <span class="comment">// Assume we have a capture.</span></div>
<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>&#160;    pwnd = pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>;</div>
<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span>&#160;    <span class="keywordflow">if</span> (!pwnd) {             <span class="comment">// If not, do the hit-testing...</span></div>
<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>&#160;        <span class="comment">// YIELD!</span></div>
<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>&#160;        hwnd = <a class="code" href="a00899.html#ac7b632aec491adfba0ade3cd2eb6dca4">xxxWindowHitTest</a>(pwndDesktop, pt, &amp;part, TRUE);</div>
<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>&#160;        <span class="keywordflow">if</span> (!hwnd || !(pwnd = <a class="code" href="a00293.html#a41d387d1b2d42169cbaa2092c8a02abf">ValidateHwnd</a>(hwnd)))</div>
<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>&#160;            pwnd = pwndDesktop;</div>
<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>&#160;    }</div>
<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>&#160; </div>
<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>&#160;<span class="comment">     * get out if somebody else has taken over hovering.</span></div>
<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>&#160;    <span class="keywordflow">if</span> (!(pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSEFIRING)) {</div>
<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>&#160;    }</div>
<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_TRACKMOUSEFIRING;</div>
<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>&#160; </div>
<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>&#160;<span class="comment">     * this must be us, make sure we are still over the right thing.</span></div>
<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>&#160;    <span class="keywordflow">if</span> ((pwnd != pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>) || (part != HTCLIENT)) {</div>
<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>&#160;        <span class="keywordflow">goto</span> cancel;</div>
<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>&#160;    }</div>
<div class="line"><a name="l02430"></a><span class="lineno"> 2430</span>&#160; </div>
<div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>&#160;<span class="comment">     * set up to check the tolerance</span></div>
<div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02434"></a><span class="lineno"> 2434</span>&#160;    wParam = <a class="code" href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb">GetMouseKeyFlags</a>(pq);</div>
<div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> != SCREEN_CAPTURE) {</div>
<div class="line"><a name="l02436"></a><span class="lineno"> 2436</span>&#160;        pt.x -= pwnd-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.left;</div>
<div class="line"><a name="l02437"></a><span class="lineno"> 2437</span>&#160;        pt.y -= pwnd-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.top;</div>
<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>&#160;    }</div>
<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>&#160; </div>
<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="a00935.html#a75b3bf802c369845c4381fcee638bc8a">PtInRect</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a72a2774228eff8f8a0c25ef4da8c8fee">rcMouseHover</a>, pt))</div>
<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>&#160; </div>
<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span>&#160;    <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(pwnd, WM_MOUSEHOVER, wParam, MAKELPARAM(pt.x, pt.y));</div>
<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span>&#160; </div>
<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>&#160;cancel:</div>
<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>&#160;    <a class="code" href="a03290.html#a7fc47e841aed29a1a3b7e99816f3f1c1">CancelMouseHover</a>(pq);</div>
<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>&#160;}</div>
<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>&#160; </div>
<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span>&#160; </div>
<div class="line"><a name="l02457"></a><span class="lineno"><a class="line" href="a03290.html#ae115b86b442f263c94c5219ccc4240cd"> 2457</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#ae115b86b442f263c94c5219ccc4240cd">ResetMouseHover</a>(</div>
<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>&#160;    POINT pt)</div>
<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span>&#160;{</div>
<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>&#160; </div>
<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span>&#160;<span class="comment">     * make sure we have something to do before we go and try to do it.</span></div>
<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span>&#160;    <span class="keywordflow">if</span> (!(pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSEHOVER))</div>
<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>&#160; </div>
<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a> == NULL) {</div>
<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>&#160;        <a class="code" href="a03290.html#ab7a8ea0145ef1df8bfb450d1ac6fed9e">ResetMouseTracking</a>(pq, NULL);</div>
<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>&#160;    }</div>
<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>&#160; </div>
<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>&#160;<span class="comment">     * set/reset the timer.</span></div>
<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>&#160;    <a class="code" href="a00887.html#a23803d0eb05592a1e1ae26b60e68b420">_SetSystemTimer</a>(pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>, IDSYS_MOUSEHOVER,</div>
<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>&#160;            pq-&gt;<a class="code" href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">dwMouseHoverTime</a>, <a class="code" href="a03290.html#ac2ac12bbb64bf174d45df0e65d717f84">xxxMouseHoverTimer</a>);</div>
<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>&#160; </div>
<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>&#160;<span class="comment">     * update the tolerance rectangle for the hover window.</span></div>
<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>&#160;    <a class="code" href="a00935.html#a479bbe69c871894f6ca23dfa237481ad">SetRect</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a72a2774228eff8f8a0c25ef4da8c8fee">rcMouseHover</a>,</div>
<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>&#160;            pt.x - <a class="code" href="a03257.html#a3c299e89eb5b0923ac37cc8d29c65d06">gcxMouseHover</a> / 2,</div>
<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span>&#160;            pt.y - <a class="code" href="a03257.html#a4a4dfda0c85b4e4ad2c10cb1f370df74">gcyMouseHover</a> / 2,</div>
<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>&#160;            pt.x + <a class="code" href="a03257.html#a3c299e89eb5b0923ac37cc8d29c65d06">gcxMouseHover</a> / 2,</div>
<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span>&#160;            pt.y + <a class="code" href="a03257.html#a4a4dfda0c85b4e4ad2c10cb1f370df74">gcyMouseHover</a> / 2);</div>
<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>&#160;}</div>
<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span>&#160; </div>
<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>&#160; </div>
<div class="line"><a name="l02497"></a><span class="lineno"><a class="line" href="a00899.html#a7fc47e841aed29a1a3b7e99816f3f1c1"> 2497</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a7fc47e841aed29a1a3b7e99816f3f1c1">CancelMouseHover</a>(<a class="code" href="a02869.html">PQ</a> pq)</div>
<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>&#160;{</div>
<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSEHOVER) {</div>
<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span>&#160;        <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a> != NULL)</div>
<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>&#160;            <a class="code" href="a00887.html#ae3b42fc45613df6ae1803075394c386a">_KillSystemTimer</a>(pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>, IDSYS_MOUSEHOVER);</div>
<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>&#160; </div>
<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span>&#160;        pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~(QF_TRACKMOUSEHOVER | QF_TRACKMOUSEFIRING);</div>
<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span>&#160;    }</div>
<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>&#160;}</div>
<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>&#160; </div>
<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span>&#160; </div>
<div class="line"><a name="l02515"></a><span class="lineno"><a class="line" href="a03290.html#a98458d5f8be030de82ee292c023bb341"> 2515</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a98458d5f8be030de82ee292c023bb341">MouseEnter</a>(</div>
<div class="line"><a name="l02516"></a><span class="lineno"> 2516</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l02517"></a><span class="lineno"> 2517</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd)</div>
<div class="line"><a name="l02518"></a><span class="lineno"> 2518</span>&#160;{</div>
<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span>&#160;<span class="comment">     * make sure something has changed...</span></div>
<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span>&#160;    <span class="keywordflow">if</span> (pwnd == pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>) {</div>
<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span>&#160;    }</div>
<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>&#160; </div>
<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>&#160;<span class="comment">     * we know the mouse left the old window so cancel its stuff</span></div>
<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>&#160;    <a class="code" href="a03290.html#a7fc47e841aed29a1a3b7e99816f3f1c1">CancelMouseHover</a>(pq);</div>
<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSELEAVE) {</div>
<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>&#160;        <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>, WM_MOUSELEAVE, 0, 0);</div>
<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>&#160;        pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_TRACKMOUSELEAVE;</div>
<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span>&#160;    }</div>
<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span>&#160; </div>
<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span>&#160;<span class="comment">     * save the new tracking window</span></div>
<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>&#160;    Lock(&amp;pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>, pwnd);</div>
<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span>&#160;}</div>
<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span>&#160; </div>
<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>&#160; </div>
<div class="line"><a name="l02549"></a><span class="lineno"><a class="line" href="a00899.html#ab7a8ea0145ef1df8bfb450d1ac6fed9e"> 2549</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#ab7a8ea0145ef1df8bfb450d1ac6fed9e">ResetMouseTracking</a>(</div>
<div class="line"><a name="l02550"></a><span class="lineno"> 2550</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l02551"></a><span class="lineno"> 2551</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd)</div>
<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span>&#160;{</div>
<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>&#160;    <span class="keywordflow">if</span> ((pwnd != NULL) &amp;&amp; (pwnd != pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>))</div>
<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span>&#160; </div>
<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>&#160;    <a class="code" href="a03290.html#a98458d5f8be030de82ee292c023bb341">MouseEnter</a>(pq, NULL);</div>
<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>&#160;}</div>
<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span>&#160; </div>
<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span>&#160; </div>
<div class="line"><a name="l02567"></a><span class="lineno"><a class="line" href="a00899.html#a1788c133e88b438738af33ef258ffb78"> 2567</a></span>&#160;BOOL <a class="code" href="a03290.html#a1788c133e88b438738af33ef258ffb78">QueryTrackMouseEvent</a>(</div>
<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span>&#160;    LPTRACKMOUSEEVENT lpTME)</div>
<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>&#160;{</div>
<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>&#160; </div>
<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span>&#160;<span class="comment">     * initialize the struct</span></div>
<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>&#160;    RtlZeroMemory(lpTME, <span class="keyword">sizeof</span>(*lpTME));</div>
<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span>&#160;    lpTME-&gt;cbSize = <span class="keyword">sizeof</span>(*lpTME);</div>
<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>&#160; </div>
<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>&#160;<span class="comment">     * if there isn&#39;t anything being tracked get out</span></div>
<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>&#160;    <span class="keywordflow">if</span> (!(pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; (QF_TRACKMOUSELEAVE | QF_TRACKMOUSEHOVER)) || !pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>)</div>
<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>&#160; </div>
<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span>&#160;<span class="comment">     * fill in the requested information</span></div>
<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSELEAVE)</div>
<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>&#160;        lpTME-&gt;dwFlags |= TME_LEAVE;</div>
<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span>&#160; </div>
<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSEHOVER) {</div>
<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>&#160;        lpTME-&gt;dwFlags |= TME_HOVER;</div>
<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>&#160;        lpTME-&gt;dwHoverTime = pq-&gt;<a class="code" href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">dwMouseHoverTime</a>;</div>
<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>&#160;    }</div>
<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>&#160; </div>
<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>&#160;    lpTME-&gt;hwndTrack = HWq(pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>);</div>
<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>&#160; </div>
<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>&#160;}</div>
<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span>&#160; </div>
<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span>&#160; </div>
<div class="line"><a name="l02608"></a><span class="lineno"><a class="line" href="a03290.html#a6342e05d127c39d3e4639914749fc79f"> 2608</a></span>&#160;BOOL <a class="code" href="a03290.html#a6342e05d127c39d3e4639914749fc79f">TrackMouseEvent</a>(</div>
<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>&#160;    LPTRACKMOUSEEVENT lpTME)</div>
<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span>&#160;{</div>
<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd;</div>
<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> dwFlags;</div>
<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>&#160;    BOOL fValidRequest;</div>
<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span>&#160; </div>
<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span>&#160;<span class="comment">     * make sure we have a valid window</span></div>
<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>&#160;    <span class="keywordflow">if</span> ((pwnd = <a class="code" href="a00293.html#a41d387d1b2d42169cbaa2092c8a02abf">ValidateHwnd</a>(lpTME-&gt;hwndTrack)) == NULL)</div>
<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>&#160; </div>
<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span>&#160;<span class="comment">     * are we going to give them what they asked for?</span></div>
<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span>&#160;    dwFlags = lpTME-&gt;dwFlags;</div>
<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span>&#160;    fValidRequest = (pwnd == pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>);</div>
<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>&#160; </div>
<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span>&#160;<span class="comment">     * does the caller want hover tracking?</span></div>
<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>&#160;    <span class="keywordflow">if</span> (fValidRequest &amp;&amp; (dwFlags &amp; TME_HOVER)) {</div>
<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span>&#160;        <span class="keywordflow">if</span> (!(dwFlags &amp; TME_CANCEL)) {</div>
<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span>&#160;            POINT pt;</div>
<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span>&#160; </div>
<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>&#160;            pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_TRACKMOUSEHOVER;</div>
<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span>&#160;            pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_TRACKMOUSEFIRING;</div>
<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>&#160;            pq-&gt;<a class="code" href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">dwMouseHoverTime</a> = lpTME-&gt;dwHoverTime;</div>
<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>&#160; </div>
<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span>&#160;            <span class="keywordflow">if</span> (!pq-&gt;<a class="code" href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">dwMouseHoverTime</a> || (pq-&gt;<a class="code" href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">dwMouseHoverTime</a> == HOVER_DEFAULT))</div>
<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span>&#160;                pq-&gt;<a class="code" href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">dwMouseHoverTime</a> = <a class="code" href="a03257.html#a888092e560f7a0919213285de1407193">gdtMouseHover</a>;</div>
<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>&#160; </div>
<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>&#160;            pt = GETPTI(pwnd)-&gt;ptLast;</div>
<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>&#160; </div>
<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>&#160;            <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> != SCREEN_CAPTURE) {</div>
<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>&#160;                pt.x -= pwnd-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.left;</div>
<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>&#160;                pt.y -= pwnd-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.top;</div>
<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span>&#160;            }</div>
<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span>&#160; </div>
<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>&#160;            <a class="code" href="a03290.html#ae115b86b442f263c94c5219ccc4240cd">ResetMouseHover</a>(pt);</div>
<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span>&#160;            <a class="code" href="a03290.html#a7fc47e841aed29a1a3b7e99816f3f1c1">CancelMouseHover</a>(pq);</div>
<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span>&#160;        }</div>
<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>&#160;    }</div>
<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>&#160; </div>
<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>&#160;<span class="comment">     * does the caller want leave tracking?</span></div>
<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>&#160;    <span class="keywordflow">if</span> (dwFlags &amp; TME_LEAVE) {</div>
<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span>&#160;        <span class="keywordflow">if</span> (!(dwFlags &amp; TME_CANCEL)) {</div>
<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>&#160;            <span class="keywordflow">if</span> (fValidRequest) {</div>
<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span>&#160;                pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_TRACKMOUSELEAVE;</div>
<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span>&#160;                <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(pwnd, WM_MOUSELEAVE, 0, 0);</div>
<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span>&#160;            }</div>
<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fValidRequest) {</div>
<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span>&#160;            pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_TRACKMOUSELEAVE;</div>
<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span>&#160;        }</div>
<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span>&#160;    }</div>
<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span>&#160; </div>
<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span>&#160;}</div>
<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span>&#160; </div>
<div class="line"><a name="l02673"></a><span class="lineno"> 2673</span>&#160; </div>
<div class="line"><a name="l02684"></a><span class="lineno"><a class="line" href="a03290.html#a7cda2eaad1e3b8c5412b982d5b64fdfe"> 2684</a></span>&#160;<a class="code" href="a02857.html">PQMSG</a> <a class="code" href="a03290.html#a7cda2eaad1e3b8c5412b982d5b64fdfe">xxxGetNextSysMsg</a>(</div>
<div class="line"><a name="l02685"></a><span class="lineno"> 2685</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02686"></a><span class="lineno"> 2686</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgPrev,</div>
<div class="line"><a name="l02687"></a><span class="lineno"> 2687</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l02688"></a><span class="lineno"> 2688</span>&#160;{</div>
<div class="line"><a name="l02689"></a><span class="lineno"> 2689</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dt;</div>
<div class="line"><a name="l02690"></a><span class="lineno"> 2690</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml;</div>
<div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgT;</div>
<div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>&#160; </div>
<div class="line"><a name="l02693"></a><span class="lineno"> 2693</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02694"></a><span class="lineno"> 2694</span>&#160;<span class="comment">     * If there is a journal playback hook, call it to get the next message.</span></div>
<div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALPLAYBACK + 1] != NULL &amp;&amp;</div>
<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span>&#160;            pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> == <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>) {</div>
<div class="line"><a name="l02698"></a><span class="lineno"> 2698</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>&#160;<span class="comment">         * We can&#39;t search through journal messages: we only get the current</span></div>
<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>&#160;<span class="comment">         * journal message. So if the caller has already called us once</span></div>
<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>&#160;<span class="comment">         * before, then exit with no messages.</span></div>
<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>&#160;        <span class="keywordflow">if</span> (pqmsgPrev != 0)</div>
<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>&#160; </div>
<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>&#160;<span class="comment">         * Tell the journal playback hook that we&#39;re done</span></div>
<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>&#160;<span class="comment">         * with this message now.</span></div>
<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>&#160;        dt = <a class="code" href="a00701.html#a541e8a7e575e8b23a5740db596eef34d">xxxCallJournalPlaybackHook</a>(pqmsg);</div>
<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>&#160;        <span class="keywordflow">if</span> (dt == 0xFFFFFFFF)</div>
<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span>&#160; </div>
<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span>&#160;<span class="comment">         * If dt == 0, then we don&#39;t need to wait: set the right wake</span></div>
<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span>&#160;<span class="comment">         * bits and return this message.</span></div>
<div class="line"><a name="l02717"></a><span class="lineno"> 2717</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02718"></a><span class="lineno"> 2718</span>&#160;        <span class="keywordflow">if</span> (dt == 0) {</div>
<div class="line"><a name="l02719"></a><span class="lineno"> 2719</span>&#160;            <a class="code" href="a03290.html#a0a3fd3f307e80195c7f13545ec5fbcff">WakeSomeone</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message, NULL);</div>
<div class="line"><a name="l02720"></a><span class="lineno"> 2720</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="a03290.html#a9c2a89c84dc8211a1e69f10e5a271ddd">PQMSG_PLAYBACK</a>;</div>
<div class="line"><a name="l02721"></a><span class="lineno"> 2721</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>&#160;<span class="comment">             * There is logically no more input in the &quot;queue&quot;, so clear the</span></div>
<div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>&#160;<span class="comment">             * bits so that we will sleep when GetMessage is called.</span></div>
<div class="line"><a name="l02725"></a><span class="lineno"> 2725</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02726"></a><span class="lineno"> 2726</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp;= ~QS_INPUT;</div>
<div class="line"><a name="l02727"></a><span class="lineno"> 2727</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp;= ~QS_INPUT;</div>
<div class="line"><a name="l02728"></a><span class="lineno"> 2728</span>&#160; </div>
<div class="line"><a name="l02729"></a><span class="lineno"> 2729</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02730"></a><span class="lineno"> 2730</span>&#160;<span class="comment">             * Need to wait before processing this next message. Set</span></div>
<div class="line"><a name="l02731"></a><span class="lineno"> 2731</span>&#160;<span class="comment">             * a journal timer.</span></div>
<div class="line"><a name="l02732"></a><span class="lineno"> 2732</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02733"></a><span class="lineno"> 2733</span>&#160;            <a class="code" href="a00887.html#a29098a85ba39b7f172fc533c86ffd129">SetJournalTimer</a>(dt, pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message);</div>
<div class="line"><a name="l02734"></a><span class="lineno"> 2734</span>&#160; </div>
<div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>&#160;        }</div>
<div class="line"><a name="l02737"></a><span class="lineno"> 2737</span>&#160;    }</div>
<div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>&#160; </div>
<div class="line"><a name="l02739"></a><span class="lineno"> 2739</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02740"></a><span class="lineno"> 2740</span>&#160;<span class="comment">     * No journalling going on... return next message in system queue.</span></div>
<div class="line"><a name="l02741"></a><span class="lineno"> 2741</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>&#160; </div>
<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>&#160;<span class="comment">     * Queue up a mouse move if the mouse has moved.</span></div>
<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_MOUSEMOVED) {</div>
<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>&#160;        <a class="code" href="a03290.html#aff53b969878a227a8d1b2a15f3439fc9">PostMove</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>);</div>
<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span>&#160;    }</div>
<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>&#160; </div>
<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>&#160;<span class="comment">     * If no messages in the input queue, return with 0.</span></div>
<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>&#160;    pml = &amp;pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>;</div>
<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a> == 0)</div>
<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>&#160; </div>
<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span>&#160;<span class="comment">     * If this is the first call to xxxGetNextSysMsg(), return the</span></div>
<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>&#160;<span class="comment">     * first message.</span></div>
<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>&#160;    <span class="keywordflow">if</span> (pqmsgPrev == NULL || pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> &lt;= (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)<a class="code" href="a03290.html#a9c2a89c84dc8211a1e69f10e5a271ddd">PQMSG_PLAYBACK</a>) {</div>
<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>&#160;        pqmsgT = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>&#160;<span class="comment">         * Otherwise return the next message in the queue. Index with</span></div>
<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>&#160;<span class="comment">         * idSysPeek, because that is updated by recursive calls through</span></div>
<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>&#160;<span class="comment">         * this code.</span></div>
<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>&#160;        pqmsgT = ((<a class="code" href="a00365.html#ad3dfd3ee6ed128bf06b47ca3d67c652b">PQMSG</a>)(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>))-&gt;pqmsgNext;</div>
<div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>&#160;    }</div>
<div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>&#160; </div>
<div class="line"><a name="l02772"></a><span class="lineno"> 2772</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02773"></a><span class="lineno"> 2773</span>&#160;<span class="comment">     * Fill in the structure passed, and return the pointer to the</span></div>
<div class="line"><a name="l02774"></a><span class="lineno"> 2774</span>&#160;<span class="comment">     * current message in the message list. This will become the new</span></div>
<div class="line"><a name="l02775"></a><span class="lineno"> 2775</span>&#160;<span class="comment">     * pq-&gt;idSysPeek.</span></div>
<div class="line"><a name="l02776"></a><span class="lineno"> 2776</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02777"></a><span class="lineno"> 2777</span>&#160;    <span class="keywordflow">if</span> (pqmsgT != NULL)</div>
<div class="line"><a name="l02778"></a><span class="lineno"> 2778</span>&#160;        *pqmsg = *pqmsgT;</div>
<div class="line"><a name="l02779"></a><span class="lineno"> 2779</span>&#160;    <span class="keywordflow">return</span> pqmsgT;</div>
<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span>&#160;}</div>
<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span>&#160; </div>
<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>&#160; </div>
<div class="line"><a name="l02790"></a><span class="lineno"><a class="line" href="a03290.html#a4fd10b4e664d465eb22efbf0e24c3ab6"> 2790</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a4fd10b4e664d465eb22efbf0e24c3ab6">UpdateKeyState</a>(</div>
<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> vk,</div>
<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span>&#160;    BOOL fDown)</div>
<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span>&#160;{</div>
<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>&#160;    <span class="keywordflow">if</span> (vk != 0) {</div>
<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>&#160;<span class="comment">         * If we&#39;re going down, toggle only if the key isn&#39;t</span></div>
<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>&#160;<span class="comment">         * already down.</span></div>
<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span>&#160;        <span class="keywordflow">if</span> (fDown &amp;&amp; !TestKeyStateDown(pq, vk)) {</div>
<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span>&#160;            <span class="keywordflow">if</span> (TestKeyStateToggle(pq, vk)) {</div>
<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span>&#160;                ClearKeyStateToggle(pq, vk);</div>
<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span>&#160;                SetKeyStateToggle(pq, vk);</div>
<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span>&#160;            }</div>
<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span>&#160;        }</div>
<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span>&#160; </div>
<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>&#160;<span class="comment">         * Now set/clear the key down state.</span></div>
<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>&#160;        <span class="keywordflow">if</span> (fDown) {</div>
<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>&#160;            SetKeyStateDown(pq, vk);</div>
<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span>&#160;            ClearKeyStateDown(pq, vk);</div>
<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>&#160;        }</div>
<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>&#160; </div>
<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>&#160;<span class="comment">         * If this is one of the keys we cache, update the key cache index.</span></div>
<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>&#160;        <span class="keywordflow">if</span> (vk &lt; CVKKEYCACHE) {</div>
<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>&#160;            <a class="code" href="a00020.html#ad760da1dd81d9e84dee607d18edfde39">gpsi</a>-&gt;<a class="code" href="a02513.html#a125933441b95aca04386827b052dfe42">dwKeyCache</a>++;</div>
<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>&#160;        }</div>
<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>&#160;    }</div>
<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>&#160;}</div>
<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>&#160; </div>
<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span>&#160; </div>
<div class="line"><a name="l02835"></a><span class="lineno"><a class="line" href="a03290.html#a7f3d348b55324c2d0626d410995a23bf"> 2835</a></span>&#160;BOOL <a class="code" href="a03290.html#a7f3d348b55324c2d0626d410995a23bf">EqualMsg</a>(<a class="code" href="a02857.html">PQMSG</a> pqmsg1, <a class="code" href="a02857.html">PQMSG</a> pqmsg2)</div>
<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>&#160;{</div>
<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>&#160;    <span class="keywordflow">if</span> (pqmsg1-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd    != pqmsg2-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd ||</div>
<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>&#160;        pqmsg1-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message != pqmsg2-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message)</div>
<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>&#160; </div>
<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>&#160;<span class="comment">     * This might be a coalesced WM_MOUSEMOVE</span></div>
<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>&#160;    <span class="keywordflow">if</span> (pqmsg1-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message == WM_MOUSEMOVE)</div>
<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>&#160; </div>
<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>&#160;    <span class="keywordflow">if</span> (pqmsg1-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>      != pqmsg2-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> ||</div>
<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>&#160;        pqmsg1-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time != pqmsg2-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time)</div>
<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>&#160; </div>
<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>&#160;}</div>
<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>&#160; </div>
<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>&#160; </div>
<div class="line"><a name="l02864"></a><span class="lineno"><a class="line" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1"> 2864</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(</div>
<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>&#160;{</div>
<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgT;</div>
<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>&#160;    BOOL  fDown;</div>
<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>&#160;    BYTE  vk;</div>
<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>&#160; </div>
<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>&#160;<span class="comment">     * If idSysPeek is 0, then the pqmsg that we were looking at has been</span></div>
<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>&#160;<span class="comment">     * deleted, probably because of a callout from ScanSysQueue, and that</span></div>
<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>&#160;<span class="comment">     * callout then called PeekMessage(fRemove == TRUE), and then returned.</span></div>
<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> == 0)</div>
<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>&#160; </div>
<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALPLAYBACK + 1] != NULL) {</div>
<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span>&#160;<span class="comment">         * Tell the journal playback hook that we&#39;re done</span></div>
<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>&#160;<span class="comment">         * with this message now.</span></div>
<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>&#160;        <a class="code" href="a02593.html">PHOOK</a> phk = <a class="code" href="a00701.html#ad33153b28bc5b4fd2ebdb3e5d085a68d">PhkFirst</a>(<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>(), WH_JOURNALPLAYBACK);</div>
<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(phk);</div>
<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>&#160; </div>
<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>&#160;        phk-&gt;<a class="code" href="a02593.html#ac8857c754110e179cc769f84373117ca">flags</a> |= HF_NEEDHC_SKIP;</div>
<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALRECORD + 1] != NULL) {</div>
<div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>&#160;<span class="comment">             * We&#39;ve processed a new message: tell the journal record</span></div>
<div class="line"><a name="l02893"></a><span class="lineno"> 2893</span>&#160;<span class="comment">             * hook what the message is.</span></div>
<div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>&#160;            <a class="code" href="a00701.html#ae3ba25da64afb34641a42f7c163aded0">xxxCallJournalRecordHook</a>(pqmsg);</div>
<div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>&#160;        }</div>
<div class="line"><a name="l02897"></a><span class="lineno"> 2897</span>&#160; </div>
<div class="line"><a name="l02898"></a><span class="lineno"> 2898</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>&#160;<span class="comment">         * If idSysPeek is 0 now, it means we&#39;ve been recursed into yet</span></div>
<div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>&#160;<span class="comment">         * again. This would confuse a journalling app, but it would confuse</span></div>
<div class="line"><a name="l02901"></a><span class="lineno"> 2901</span>&#160;<span class="comment">         * us more because we&#39;d fault. Return if idSysPeek is 0.</span></div>
<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>&#160;        <span class="keywordflow">if</span> ((pqmsgT = (<a class="code" href="a02857.html">PQMSG</a>)pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>) == NULL)</div>
<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>&#160; </div>
<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>&#160;<span class="comment">         * Delete this message from the input queue. Make sure pqmsgT isn&#39;t</span></div>
<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>&#160;<span class="comment">         * 1: this could happen if an app unhooked a journal record hook</span></div>
<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>&#160;<span class="comment">         * during a callback from xxxScanSysQueue.</span></div>
<div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>&#160;        <span class="keywordflow">if</span> (pqmsgT != <a class="code" href="a03290.html#a9c2a89c84dc8211a1e69f10e5a271ddd">PQMSG_PLAYBACK</a>) {</div>
<div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>&#160;<span class="comment">             * There are cases when idSysPeek points to a different message</span></div>
<div class="line"><a name="l02914"></a><span class="lineno"> 2914</span>&#160;<span class="comment">             * than the one we are trying to remove. This can happen if</span></div>
<div class="line"><a name="l02915"></a><span class="lineno"> 2915</span>&#160;<span class="comment">             * two threads enters in xxxScanSysQueue, sets the idSysPeek and</span></div>
<div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>&#160;<span class="comment">             * after this their queues got redistributed. The first thread</span></div>
<div class="line"><a name="l02917"></a><span class="lineno"> 2917</span>&#160;<span class="comment">             * will have the idSysPeek preserved but the second one has to</span></div>
<div class="line"><a name="l02918"></a><span class="lineno"> 2918</span>&#160;<span class="comment">             * search the queue for its message. - ask CLupu</span></div>
<div class="line"><a name="l02919"></a><span class="lineno"> 2919</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02920"></a><span class="lineno"> 2920</span>&#160;            <span class="keywordflow">if</span> (!<a class="code" href="a03290.html#a7f3d348b55324c2d0626d410995a23bf">EqualMsg</a>(pqmsgT, pqmsg)) {</div>
<div class="line"><a name="l02921"></a><span class="lineno"> 2921</span>&#160; </div>
<div class="line"><a name="l02922"></a><span class="lineno"> 2922</span>&#160;                <a class="code" href="a02857.html">PQMSG</a> pqmsgS;</div>
<div class="line"><a name="l02923"></a><span class="lineno"> 2923</span>&#160; </div>
<div class="line"><a name="l02924"></a><span class="lineno"> 2924</span>&#160;<span class="preprocessor">#ifdef TRACESYSPEEK</span></div>
<div class="line"><a name="l02925"></a><span class="lineno"> 2925</span>&#160;                gnSysPeekSearch++;</div>
<div class="line"><a name="l02926"></a><span class="lineno"> 2926</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02927"></a><span class="lineno"> 2927</span>&#160; </div>
<div class="line"><a name="l02928"></a><span class="lineno"> 2928</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l02929"></a><span class="lineno"> 2929</span>&#160;                KdPrint((</div>
<div class="line"><a name="l02930"></a><span class="lineno"> 2930</span>&#160;                        <span class="stringliteral">&quot;\nDifferent message than idSysPeek\n\n&quot;</span></div>
<div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>&#160;                        <span class="stringliteral">&quot;pqmsg   = %08lx  idSysPeek = %08lx\n&quot;</span></div>
<div class="line"><a name="l02932"></a><span class="lineno"> 2932</span>&#160;                        <span class="stringliteral">&quot;pti     = %08lx  pti       = %08lx\n&quot;</span></div>
<div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>&#160;                        <span class="stringliteral">&quot;msg     = %08lx  msg       = %08lx\n&quot;</span></div>
<div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>&#160;                        <span class="stringliteral">&quot;hwnd    = %08lx  hwnd      = %08lx\n&quot;</span></div>
<div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>&#160;                        <span class="stringliteral">&quot;wParam  = %08lx  wParam    = %08lx\n&quot;</span></div>
<div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>&#160;                        <span class="stringliteral">&quot;lParam  = %08lx  lParam    = %08lx\n&quot;</span></div>
<div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>&#160;                        <span class="stringliteral">&quot;time    = %08lx  time      = %08lx\n&quot;</span></div>
<div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>&#160;                        <span class="stringliteral">&quot;Extra   = %08lx  Extra     = %08lx\n&quot;</span></div>
<div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>&#160;                        <span class="stringliteral">&quot;\npqmsgT  = %08lx\n\n&quot;</span>,</div>
<div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>&#160;                        pqmsg,              pqmsgT,</div>
<div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>,         pqmsgT-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>,</div>
<div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message, pqmsgT-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message,</div>
<div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd,    pqmsgT-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd,</div>
<div class="line"><a name="l02944"></a><span class="lineno"> 2944</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam,  pqmsgT-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam,</div>
<div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam,  pqmsgT-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam,</div>
<div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time,    pqmsgT-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time,</div>
<div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>&#160;                        pqmsg-&gt;<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>,   pqmsgT-&gt;<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>,</div>
<div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>&#160;                        pqmsgT));</div>
<div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>&#160;<span class="comment">                 * Begin to search for this message</span></div>
<div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l02953"></a><span class="lineno"> 2953</span>&#160;                pqmsgS = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l02954"></a><span class="lineno"> 2954</span>&#160; </div>
<div class="line"><a name="l02955"></a><span class="lineno"> 2955</span>&#160;                <span class="keywordflow">while</span> (pqmsgS != NULL) {</div>
<div class="line"><a name="l02956"></a><span class="lineno"> 2956</span>&#160;                    <span class="keywordflow">if</span> (<a class="code" href="a03290.html#a7f3d348b55324c2d0626d410995a23bf">EqualMsg</a>(pqmsgS, pqmsg)) {</div>
<div class="line"><a name="l02957"></a><span class="lineno"> 2957</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l02958"></a><span class="lineno"> 2958</span>&#160;                        KdPrint((<span class="stringliteral">&quot;Deleting pqmsg %lx, pti %lx\n&quot;</span>,</div>
<div class="line"><a name="l02959"></a><span class="lineno"> 2959</span>&#160;                               pqmsgS, pqmsgS-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>));</div>
<div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>&#160; </div>
<div class="line"><a name="l02961"></a><span class="lineno"> 2961</span>&#160;                        KdPrint((<span class="stringliteral">&quot;m %04lx, w %lx, l %lx, t %lx\n&quot;</span>,</div>
<div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>&#160;                               pqmsgS-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message, pqmsgS-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd,</div>
<div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>&#160;                               pqmsgS-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam, pqmsgS-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time));</div>
<div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>&#160;                        pqmsgT = pqmsgS;</div>
<div class="line"><a name="l02966"></a><span class="lineno"> 2966</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>&#160;                    }</div>
<div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>&#160;                    pqmsgS = pqmsgS-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>&#160;                }</div>
<div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>&#160;                <span class="keywordflow">if</span> (pqmsgS == NULL) {</div>
<div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>&#160;                    KdPrint((<span class="stringliteral">&quot;Didn&#39;t find a matching message. No message removed\n&quot;</span>));</div>
<div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>&#160;                }</div>
<div class="line"><a name="l02976"></a><span class="lineno"> 2976</span>&#160;            }</div>
<div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>&#160; </div>
<div class="line"><a name="l02978"></a><span class="lineno"> 2978</span>&#160;            <span class="keywordflow">if</span> (pqmsgT == (<a class="code" href="a02857.html">PQMSG</a>)pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>) {</div>
<div class="line"><a name="l02979"></a><span class="lineno"> 2979</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l02980"></a><span class="lineno"> 2980</span>&#160;<span class="comment">                 * We&#39;ll remove this message from the input queue</span></div>
<div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>&#160;<span class="comment">                 * so set idSysPeek to 0.</span></div>
<div class="line"><a name="l02982"></a><span class="lineno"> 2982</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>&#160;                <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(1, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, 0);</div>
<div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>&#160;                pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>&#160;            }</div>
<div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>&#160;            <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(&amp;pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>, pqmsgT);</div>
<div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>&#160;        }</div>
<div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>&#160;    }</div>
<div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>&#160; </div>
<div class="line"><a name="l02990"></a><span class="lineno"> 2990</span>&#160;    fDown = TRUE;</div>
<div class="line"><a name="l02991"></a><span class="lineno"> 2991</span>&#160;    vk = 0;</div>
<div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>&#160; </div>
<div class="line"><a name="l02993"></a><span class="lineno"> 2993</span>&#160;    <span class="keywordflow">switch</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message) {</div>
<div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>&#160;    <span class="keywordflow">case</span> WM_MOUSEMOVE:</div>
<div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>&#160;    <span class="keywordflow">case</span> WM_QUEUESYNC:</div>
<div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>&#160;    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>&#160;<span class="comment">         * No state change.</span></div>
<div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>&#160; </div>
<div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>&#160;    <span class="keywordflow">case</span> WM_KEYUP:</div>
<div class="line"><a name="l03003"></a><span class="lineno"> 3003</span>&#160;    <span class="keywordflow">case</span> WM_SYSKEYUP:</div>
<div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>&#160;        fDown = FALSE;</div>
<div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>&#160; </div>
<div class="line"><a name="l03006"></a><span class="lineno"> 3006</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>&#160;    <span class="keywordflow">case</span> WM_KEYDOWN:</div>
<div class="line"><a name="l03010"></a><span class="lineno"> 3010</span>&#160;    <span class="keywordflow">case</span> WM_SYSKEYDOWN:</div>
<div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>&#160;        vk = LOBYTE(LOWORD(pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam));</div>
<div class="line"><a name="l03012"></a><span class="lineno"> 3012</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>&#160; </div>
<div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>&#160;    <span class="keywordflow">case</span> WM_LBUTTONUP:</div>
<div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>&#160;        fDown = FALSE;</div>
<div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>&#160; </div>
<div class="line"><a name="l03017"></a><span class="lineno"> 3017</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03018"></a><span class="lineno"> 3018</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>&#160;    <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>&#160;        vk = VK_LBUTTON;</div>
<div class="line"><a name="l03022"></a><span class="lineno"> 3022</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03023"></a><span class="lineno"> 3023</span>&#160; </div>
<div class="line"><a name="l03024"></a><span class="lineno"> 3024</span>&#160;    <span class="keywordflow">case</span> WM_RBUTTONUP:</div>
<div class="line"><a name="l03025"></a><span class="lineno"> 3025</span>&#160;        fDown = FALSE;</div>
<div class="line"><a name="l03026"></a><span class="lineno"> 3026</span>&#160; </div>
<div class="line"><a name="l03027"></a><span class="lineno"> 3027</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03028"></a><span class="lineno"> 3028</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l03029"></a><span class="lineno"> 3029</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03030"></a><span class="lineno"> 3030</span>&#160;    <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l03031"></a><span class="lineno"> 3031</span>&#160;        vk = VK_RBUTTON;</div>
<div class="line"><a name="l03032"></a><span class="lineno"> 3032</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03033"></a><span class="lineno"> 3033</span>&#160; </div>
<div class="line"><a name="l03034"></a><span class="lineno"> 3034</span>&#160;    <span class="keywordflow">case</span> WM_MBUTTONUP:</div>
<div class="line"><a name="l03035"></a><span class="lineno"> 3035</span>&#160;        fDown = FALSE;</div>
<div class="line"><a name="l03036"></a><span class="lineno"> 3036</span>&#160; </div>
<div class="line"><a name="l03037"></a><span class="lineno"> 3037</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03038"></a><span class="lineno"> 3038</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l03039"></a><span class="lineno"> 3039</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03040"></a><span class="lineno"> 3040</span>&#160;    <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l03041"></a><span class="lineno"> 3041</span>&#160;        vk = VK_MBUTTON;</div>
<div class="line"><a name="l03042"></a><span class="lineno"> 3042</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03043"></a><span class="lineno"> 3043</span>&#160;    }</div>
<div class="line"><a name="l03044"></a><span class="lineno"> 3044</span>&#160; </div>
<div class="line"><a name="l03045"></a><span class="lineno"> 3045</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03046"></a><span class="lineno"> 3046</span>&#160;<span class="comment">     * Set toggle and down bits appropriately.</span></div>
<div class="line"><a name="l03047"></a><span class="lineno"> 3047</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03048"></a><span class="lineno"> 3048</span>&#160;    <span class="keywordflow">if</span> ((vk == VK_SHIFT) || (vk == VK_MENU) || (vk == VK_CONTROL)) {</div>
<div class="line"><a name="l03049"></a><span class="lineno"> 3049</span>&#160;        BYTE vkHanded, vkOtherHand;</div>
<div class="line"><a name="l03050"></a><span class="lineno"> 3050</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03051"></a><span class="lineno"> 3051</span>&#160;<span class="comment">         * Convert this virtual key into a differentiated (Left/Right) key</span></div>
<div class="line"><a name="l03052"></a><span class="lineno"> 3052</span>&#160;<span class="comment">         * depending on the extended key bit.</span></div>
<div class="line"><a name="l03053"></a><span class="lineno"> 3053</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03054"></a><span class="lineno"> 3054</span>&#160;        vkHanded = (vk - VK_SHIFT) * 2 + VK_LSHIFT +</div>
<div class="line"><a name="l03055"></a><span class="lineno"> 3055</span>&#160;                ((pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam &amp; <a class="code" href="a00347.html#aa8286b6273fa173b26ea440fde99d8c9">EXTENDED_BIT</a>) ? 1 : 0);</div>
<div class="line"><a name="l03056"></a><span class="lineno"> 3056</span>&#160;        vkOtherHand = vkHanded ^ 1;</div>
<div class="line"><a name="l03057"></a><span class="lineno"> 3057</span>&#160; </div>
<div class="line"><a name="l03058"></a><span class="lineno"> 3058</span>&#160;        <span class="keywordflow">if</span> (vk == VK_SHIFT) {</div>
<div class="line"><a name="l03059"></a><span class="lineno"> 3059</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03060"></a><span class="lineno"> 3060</span>&#160;<span class="comment">             * Clear extended bit for r.h. Shift, since it isn&#39;t really</span></div>
<div class="line"><a name="l03061"></a><span class="lineno"> 3061</span>&#160;<span class="comment">             * extended (bit was set to indicate right-handed)</span></div>
<div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>&#160;            pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam &amp;= ~<a class="code" href="a00347.html#aa8286b6273fa173b26ea440fde99d8c9">EXTENDED_BIT</a>;</div>
<div class="line"><a name="l03064"></a><span class="lineno"> 3064</span>&#160;        }</div>
<div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>&#160; </div>
<div class="line"><a name="l03066"></a><span class="lineno"> 3066</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03067"></a><span class="lineno"> 3067</span>&#160;<span class="comment">         * Update the key state for the differentiated (Left/Right) key.</span></div>
<div class="line"><a name="l03068"></a><span class="lineno"> 3068</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03069"></a><span class="lineno"> 3069</span>&#160;        <a class="code" href="a03290.html#a4fd10b4e664d465eb22efbf0e24c3ab6">UpdateKeyState</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, vkHanded, fDown);</div>
<div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>&#160; </div>
<div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>&#160;<span class="comment">         * Update key state for the undifferentiated (logical) key.</span></div>
<div class="line"><a name="l03073"></a><span class="lineno"> 3073</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03074"></a><span class="lineno"> 3074</span>&#160;        <span class="keywordflow">if</span> (fDown || !TestKeyStateDown(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, vkOtherHand)) {</div>
<div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>&#160;            <a class="code" href="a03290.html#a4fd10b4e664d465eb22efbf0e24c3ab6">UpdateKeyState</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, vk, fDown);</div>
<div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>&#160;        }</div>
<div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03078"></a><span class="lineno"> 3078</span>&#160;        <a class="code" href="a03290.html#a4fd10b4e664d465eb22efbf0e24c3ab6">UpdateKeyState</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, vk, fDown);</div>
<div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>&#160;    }</div>
<div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>&#160;}</div>
<div class="line"><a name="l03081"></a><span class="lineno"> 3081</span>&#160; </div>
<div class="line"><a name="l03082"></a><span class="lineno"> 3082</span>&#160; </div>
<div class="line"><a name="l03089"></a><span class="lineno"><a class="line" href="a03290.html#a72e82eeda3a22802abb8bd4b4bfb5c61"> 3089</a></span>&#160;BOOL <a class="code" href="a03290.html#a72e82eeda3a22802abb8bd4b4bfb5c61">CloseScrennSaverWindow</a>(</div>
<div class="line"><a name="l03090"></a><span class="lineno"> 3090</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l03091"></a><span class="lineno"> 3091</span>&#160;{</div>
<div class="line"><a name="l03092"></a><span class="lineno"> 3092</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndDesktop, pwndChild;</div>
<div class="line"><a name="l03093"></a><span class="lineno"> 3093</span>&#160; </div>
<div class="line"><a name="l03094"></a><span class="lineno"> 3094</span>&#160;    <a class="code" href="a02609.html">PDESKTOPINFO</a> pdi;</div>
<div class="line"><a name="l03095"></a><span class="lineno"> 3095</span>&#160; </div>
<div class="line"><a name="l03096"></a><span class="lineno"> 3096</span>&#160;    pdi = pti-&gt;<a class="code" href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>;</div>
<div class="line"><a name="l03097"></a><span class="lineno"> 3097</span>&#160; </div>
<div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>&#160;    <span class="keywordflow">if</span> (!pdi)</div>
<div class="line"><a name="l03099"></a><span class="lineno"> 3099</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03100"></a><span class="lineno"> 3100</span>&#160; </div>
<div class="line"><a name="l03101"></a><span class="lineno"> 3101</span>&#160;    pwndDesktop = pdi-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>;</div>
<div class="line"><a name="l03102"></a><span class="lineno"> 3102</span>&#160; </div>
<div class="line"><a name="l03103"></a><span class="lineno"> 3103</span>&#160;    <span class="keywordflow">if</span> (!pwndDesktop)</div>
<div class="line"><a name="l03104"></a><span class="lineno"> 3104</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03105"></a><span class="lineno"> 3105</span>&#160; </div>
<div class="line"><a name="l03106"></a><span class="lineno"> 3106</span>&#160;    pwndChild = pwndDesktop-&gt;<a class="code" href="a02581.html#a6171c9000ea2060597a9bcf498ee0316">spwndChild</a>;</div>
<div class="line"><a name="l03107"></a><span class="lineno"> 3107</span>&#160; </div>
<div class="line"><a name="l03108"></a><span class="lineno"> 3108</span>&#160;    <span class="keywordflow">while</span> (pwndChild) {</div>
<div class="line"><a name="l03109"></a><span class="lineno"> 3109</span>&#160;        <span class="keywordflow">if</span> (pwndChild-&gt;<a class="code" href="a02581.html#a6be2d067ba15d4ec8cfc2e87922094f5">head</a>.<a class="code" href="a02545.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> == pti) {</div>
<div class="line"><a name="l03110"></a><span class="lineno"> 3110</span>&#160; </div>
<div class="line"><a name="l03111"></a><span class="lineno"> 3111</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03112"></a><span class="lineno"> 3112</span>&#160;<span class="comment">             * pwndChild is now the screen saver&#39;s main window</span></div>
<div class="line"><a name="l03113"></a><span class="lineno"> 3113</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03114"></a><span class="lineno"> 3114</span>&#160; </div>
<div class="line"><a name="l03115"></a><span class="lineno"> 3115</span>&#160;            <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(pwndChild, WM_CLOSE, 0, 0);</div>
<div class="line"><a name="l03116"></a><span class="lineno"> 3116</span>&#160;            <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l03117"></a><span class="lineno"> 3117</span>&#160;        }</div>
<div class="line"><a name="l03118"></a><span class="lineno"> 3118</span>&#160;        pwndChild = pwndChild-&gt;<a class="code" href="a02581.html#af729b7de7a8fb84b70b70c4b401ce789">spwndNext</a>;</div>
<div class="line"><a name="l03119"></a><span class="lineno"> 3119</span>&#160;    }</div>
<div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>&#160; </div>
<div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>&#160;}</div>
<div class="line"><a name="l03123"></a><span class="lineno"> 3123</span>&#160; </div>
<div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>&#160; </div>
<div class="line"><a name="l03133"></a><span class="lineno"><a class="line" href="a03290.html#a4679d8ea8690999a6c6c7c0cb245c879"> 3133</a></span>&#160;<span class="preprocessor">#define THRESHOLD   3</span></div>
<div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>&#160; </div>
<div class="line"><a name="l03135"></a><span class="lineno"><a class="line" href="a00824.html#a85b93c8ee73cb5dc4eb0e7b3221a454a"> 3135</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a85b93c8ee73cb5dc4eb0e7b3221a454a">ScreenSaverCheck</a>(</div>
<div class="line"><a name="l03136"></a><span class="lineno"> 3136</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l03137"></a><span class="lineno"> 3137</span>&#160;{</div>
<div class="line"><a name="l03138"></a><span class="lineno"> 3138</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wWakeBit;</div>
<div class="line"><a name="l03139"></a><span class="lineno"> 3139</span>&#160;    <span class="keyword">extern</span> POINT <a class="code" href="a00689.html#a5c0ed66b17009c8015022673ff5fcbdc">gptSSCursor</a>;</div>
<div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>&#160; </div>
<div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>&#160;<span class="comment">     * We&#39;ve hit a bug where the screen blanker (a TOPMOST window) doesn&#39;t</span></div>
<div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>&#160;<span class="comment">     * ever go away if a background process is using all available CPU cycles.</span></div>
<div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>&#160;<span class="comment">     * This is because the screen-saver&#39;s priority is lowered upon creation</span></div>
<div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>&#160;<span class="comment">     * (so it doesn&#39;t slow down background operations) and it never gets a</span></div>
<div class="line"><a name="l03146"></a><span class="lineno"> 3146</span>&#160;<span class="comment">     * chance to look for input.  The fix is to raise its priority back to</span></div>
<div class="line"><a name="l03147"></a><span class="lineno"> 3147</span>&#160;<span class="comment">     * normal when it receives input plus give it the highest boost to make</span></div>
<div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>&#160;<span class="comment">     * sure it wakes up.</span></div>
<div class="line"><a name="l03149"></a><span class="lineno"> 3149</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03150"></a><span class="lineno"> 3150</span>&#160;    wWakeBit = pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a>;</div>
<div class="line"><a name="l03151"></a><span class="lineno"> 3151</span>&#160;    <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SCREENSAVER) &amp;&amp; (wWakeBit &amp; (QS_KEY | QS_MOUSE))) {</div>
<div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>&#160; </div>
<div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03154"></a><span class="lineno"> 3154</span>&#160;<span class="comment">         * If this is a mouse-move event, make sure the mouse has</span></div>
<div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>&#160;<span class="comment">         * actually moved and this isn&#39;t some SetFMouseMoved()</span></div>
<div class="line"><a name="l03156"></a><span class="lineno"> 3156</span>&#160;<span class="comment">         * generated by the window manager.</span></div>
<div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03158"></a><span class="lineno"> 3158</span>&#160;        <span class="keywordflow">if</span> (!(wWakeBit &amp; QS_MOUSEMOVE) ||</div>
<div class="line"><a name="l03159"></a><span class="lineno"> 3159</span>&#160;                ((abs(ptCursor.x - <a class="code" href="a00689.html#a5c0ed66b17009c8015022673ff5fcbdc">gptSSCursor</a>.x) &gt; <a class="code" href="a03290.html#a4679d8ea8690999a6c6c7c0cb245c879">THRESHOLD</a>) ||</div>
<div class="line"><a name="l03160"></a><span class="lineno"> 3160</span>&#160;                (abs(ptCursor.y - <a class="code" href="a00689.html#a5c0ed66b17009c8015022673ff5fcbdc">gptSSCursor</a>.y) &gt; <a class="code" href="a03290.html#a4679d8ea8690999a6c6c7c0cb245c879">THRESHOLD</a>))) {</div>
<div class="line"><a name="l03161"></a><span class="lineno"> 3161</span>&#160; </div>
<div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03163"></a><span class="lineno"> 3163</span>&#160;<span class="comment">             * This will set this processes priority to the foreground</span></div>
<div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>&#160;<span class="comment">             * priority saved in the EPROCESS structure. In the case</span></div>
<div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>&#160;<span class="comment">             * of the screen saver, this priority will be the one it</span></div>
<div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>&#160;<span class="comment">             * started with, which will be foreground of normal. This</span></div>
<div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>&#160;<span class="comment">             * will give it enough juice to exit ok.</span></div>
<div class="line"><a name="l03168"></a><span class="lineno"> 3168</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>&#160;            pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp;= ~TIF_SCREENSAVER;</div>
<div class="line"><a name="l03170"></a><span class="lineno"> 3170</span>&#160;            <a class="code" href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a>(pti, TRUE);</div>
<div class="line"><a name="l03171"></a><span class="lineno"> 3171</span>&#160; </div>
<div class="line"><a name="l03172"></a><span class="lineno"> 3172</span>&#160;            <span class="keywordflow">if</span> (!<a class="code" href="a03290.html#a72e82eeda3a22802abb8bd4b4bfb5c61">CloseScrennSaverWindow</a>( pti )) {</div>
<div class="line"><a name="l03173"></a><span class="lineno"> 3173</span>&#160; </div>
<div class="line"><a name="l03174"></a><span class="lineno"> 3174</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03175"></a><span class="lineno"> 3175</span>&#160;<span class="comment">                 * Sometimes the screen saver app has not created a window yet,</span></div>
<div class="line"><a name="l03176"></a><span class="lineno"> 3176</span>&#160;<span class="comment">                 * and will not receive this mouse / key input. That is why</span></div>
<div class="line"><a name="l03177"></a><span class="lineno"> 3177</span>&#160;<span class="comment">                 * we ensure that it quits.</span></div>
<div class="line"><a name="l03178"></a><span class="lineno"> 3178</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03179"></a><span class="lineno"> 3179</span>&#160; </div>
<div class="line"><a name="l03180"></a><span class="lineno"> 3180</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> = 1;</div>
<div class="line"><a name="l03181"></a><span class="lineno"> 3181</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> |= (QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l03182"></a><span class="lineno"> 3182</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> |= (QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l03183"></a><span class="lineno"> 3183</span>&#160;            }</div>
<div class="line"><a name="l03184"></a><span class="lineno"> 3184</span>&#160;        }</div>
<div class="line"><a name="l03185"></a><span class="lineno"> 3185</span>&#160;    }</div>
<div class="line"><a name="l03186"></a><span class="lineno"> 3186</span>&#160;}</div>
<div class="line"><a name="l03187"></a><span class="lineno"> 3187</span>&#160; </div>
<div class="line"><a name="l03188"></a><span class="lineno"> 3188</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l03189"></a><span class="lineno"> 3189</span>&#160; </div>
<div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>&#160;<span class="keywordtype">void</span> LogPlayback(</div>
<div class="line"><a name="l03198"></a><span class="lineno"> 3198</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>&#160;    PMSG lpmsg)</div>
<div class="line"><a name="l03200"></a><span class="lineno"> 3200</span>&#160;{</div>
<div class="line"><a name="l03201"></a><span class="lineno"> 3201</span>&#160;    <span class="keyword">static</span> <a class="code" href="a02581.html">PWND</a> pwndM = NULL, pwndK = NULL;</div>
<div class="line"><a name="l03202"></a><span class="lineno"> 3202</span>&#160;    LPCSTR lpszMsg;</div>
<div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>&#160;    <a class="code" href="a00953.html#aebb9e13210d88d43e32e735ada43a425">CHAR</a> achBuf[20];</div>
<div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>&#160; </div>
<div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>&#160;    <span class="keywordflow">if</span> ((lpmsg-&gt;message &gt;= WM_MOUSEFIRST) &amp;&amp; (lpmsg-&gt;message &lt;= WM_MOUSELAST)) {</div>
<div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>&#160;        lpszMsg = aszMouse[lpmsg-&gt;message - WM_MOUSEFIRST];</div>
<div class="line"><a name="l03207"></a><span class="lineno"> 3207</span>&#160;        <span class="keywordflow">if</span> (pwnd != pwndM) {</div>
<div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>&#160;            DbgPrint(<span class="stringliteral">&quot;*** Mouse input to window \&quot;%ws\&quot; of class \&quot;%s\&quot;\n&quot;</span>,</div>
<div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>&#160;                    pwnd-&gt;<a class="code" href="a02581.html#a5242d6e2f6cd000e8a85dcd824104ec4">strName</a>.<a class="code" href="a02457.html#abfb371817eb1c8f0d8a165bb2b798092">Length</a> ? pwnd-&gt;<a class="code" href="a02581.html#a5242d6e2f6cd000e8a85dcd824104ec4">strName</a>.<a class="code" href="a02457.html#a99314e2f6ea6b552b9538bbe7b7e64ba">Buffer</a> : L<span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>&#160;                    pwnd-&gt;<a class="code" href="a02581.html#a9ac6b15978318e3401ef9a878ccb40ac">pcls</a>-&gt;lpszAnsiClassName);</div>
<div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>&#160;            pwndM = pwnd;</div>
<div class="line"><a name="l03212"></a><span class="lineno"> 3212</span>&#160;        }</div>
<div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((lpmsg-&gt;message &gt;= WM_KEYFIRST) &amp;&amp; (lpmsg-&gt;message &lt;= WM_KEYLAST)) {</div>
<div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>&#160;        lpszMsg = aszKey[lpmsg-&gt;message - WM_KEYFIRST];</div>
<div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>&#160;        <span class="keywordflow">if</span> (pwnd != pwndK) {</div>
<div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>&#160;            DbgPrint(<span class="stringliteral">&quot;*** Kbd input to window \&quot;%ws\&quot; of class \&quot;%s\&quot;\n&quot;</span>,</div>
<div class="line"><a name="l03217"></a><span class="lineno"> 3217</span>&#160;                    pwnd-&gt;<a class="code" href="a02581.html#a5242d6e2f6cd000e8a85dcd824104ec4">strName</a>.<a class="code" href="a02457.html#abfb371817eb1c8f0d8a165bb2b798092">Length</a> ? pwnd-&gt;<a class="code" href="a02581.html#a5242d6e2f6cd000e8a85dcd824104ec4">strName</a>.<a class="code" href="a02457.html#a99314e2f6ea6b552b9538bbe7b7e64ba">Buffer</a> : L<span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>&#160;                    pwnd-&gt;<a class="code" href="a02581.html#a9ac6b15978318e3401ef9a878ccb40ac">pcls</a>-&gt;lpszAnsiClassName);</div>
<div class="line"><a name="l03219"></a><span class="lineno"> 3219</span>&#160;            pwndK = pwnd;</div>
<div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>&#160;        }</div>
<div class="line"><a name="l03221"></a><span class="lineno"> 3221</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lpmsg-&gt;message == WM_QUEUESYNC) {</div>
<div class="line"><a name="l03222"></a><span class="lineno"> 3222</span>&#160;        lpszMsg = <span class="stringliteral">&quot;WM_QUEUESYNC&quot;</span>;</div>
<div class="line"><a name="l03223"></a><span class="lineno"> 3223</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03224"></a><span class="lineno"> 3224</span>&#160;        <a class="code" href="a00938.html#a2b7e151e7244f61923da5729bddc63cf">wsprintfA</a>(achBuf, <span class="stringliteral">&quot;0x%4x&quot;</span>, lpmsg-&gt;message);</div>
<div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>&#160;        lpszMsg = achBuf;</div>
<div class="line"><a name="l03226"></a><span class="lineno"> 3226</span>&#160;    }</div>
<div class="line"><a name="l03227"></a><span class="lineno"> 3227</span>&#160;    DbgPrint(<span class="stringliteral">&quot;msg = %s, wP = %x, lP = %x\n&quot;</span>, lpszMsg,</div>
<div class="line"><a name="l03228"></a><span class="lineno"> 3228</span>&#160;            lpmsg-&gt;wParam, lpmsg-&gt;lParam);</div>
<div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>&#160;}</div>
<div class="line"><a name="l03230"></a><span class="lineno"> 3230</span>&#160;<span class="preprocessor">#endif  // DBG</span></div>
<div class="line"><a name="l03231"></a><span class="lineno"> 3231</span>&#160; </div>
<div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>&#160; </div>
<div class="line"><a name="l03241"></a><span class="lineno"><a class="line" href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb"> 3241</a></span>&#160;<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> <a class="code" href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb">GetMouseKeyFlags</a>(</div>
<div class="line"><a name="l03242"></a><span class="lineno"> 3242</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq)</div>
<div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>&#160;{</div>
<div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wParam = 0;</div>
<div class="line"><a name="l03245"></a><span class="lineno"> 3245</span>&#160; </div>
<div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>&#160;    <span class="keywordflow">if</span> (TestKeyStateDown(pq, VK_LBUTTON))</div>
<div class="line"><a name="l03247"></a><span class="lineno"> 3247</span>&#160;        wParam |= MK_LBUTTON;</div>
<div class="line"><a name="l03248"></a><span class="lineno"> 3248</span>&#160;    <span class="keywordflow">if</span> (TestKeyStateDown(pq, VK_RBUTTON))</div>
<div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>&#160;        wParam |= MK_RBUTTON;</div>
<div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>&#160;    <span class="keywordflow">if</span> (TestKeyStateDown(pq, VK_MBUTTON))</div>
<div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>&#160;        wParam |= MK_MBUTTON;</div>
<div class="line"><a name="l03252"></a><span class="lineno"> 3252</span>&#160;    <span class="keywordflow">if</span> (TestKeyStateDown(pq, VK_SHIFT))</div>
<div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>&#160;        wParam |= MK_SHIFT;</div>
<div class="line"><a name="l03254"></a><span class="lineno"> 3254</span>&#160;    <span class="keywordflow">if</span> (TestKeyStateDown(pq, VK_CONTROL))</div>
<div class="line"><a name="l03255"></a><span class="lineno"> 3255</span>&#160;        wParam |= MK_CONTROL;</div>
<div class="line"><a name="l03256"></a><span class="lineno"> 3256</span>&#160; </div>
<div class="line"><a name="l03257"></a><span class="lineno"> 3257</span>&#160;    <span class="keywordflow">return</span> wParam;</div>
<div class="line"><a name="l03258"></a><span class="lineno"> 3258</span>&#160;}</div>
<div class="line"><a name="l03259"></a><span class="lineno"> 3259</span>&#160; </div>
<div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>&#160; </div>
<div class="line"><a name="l03275"></a><span class="lineno"><a class="line" href="a03290.html#ae9dbe0a05586078bb0d0bc5762533895"> 3275</a></span>&#160;BOOL <a class="code" href="a03290.html#ae9dbe0a05586078bb0d0bc5762533895">xxxScanSysQueue</a>(</div>
<div class="line"><a name="l03276"></a><span class="lineno"> 3276</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent,</div>
<div class="line"><a name="l03277"></a><span class="lineno"> 3277</span>&#160;    LPMSG lpMsg,</div>
<div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndFilter,</div>
<div class="line"><a name="l03279"></a><span class="lineno"> 3279</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMinFilter,</div>
<div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMaxFilter,</div>
<div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> flags,</div>
<div class="line"><a name="l03282"></a><span class="lineno"> 3282</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> fsReason)</div>
<div class="line"><a name="l03283"></a><span class="lineno"> 3283</span>&#160;{</div>
<div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>&#160;    <a class="code" href="a02857.html">QMSG</a> qmsg;</div>
<div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>&#160;    HWND hwnd;</div>
<div class="line"><a name="l03286"></a><span class="lineno"> 3286</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd;</div>
<div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message;</div>
<div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wParam;</div>
<div class="line"><a name="l03289"></a><span class="lineno"> 3289</span>&#160;    LONG lParam;</div>
<div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiKeyWake, ptiMouseWake, ptiEventWake;</div>
<div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>&#160;    POINT pt;</div>
<div class="line"><a name="l03292"></a><span class="lineno"> 3292</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> codeMouseDown;</div>
<div class="line"><a name="l03293"></a><span class="lineno"> 3293</span>&#160;    BOOL fMouseHookCalled;</div>
<div class="line"><a name="l03294"></a><span class="lineno"> 3294</span>&#160;    BOOL fKbdHookCalled;</div>
<div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>&#160;    BOOL fOtherApp;</div>
<div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>&#160;    <span class="keywordtype">int</span> part;</div>
<div class="line"><a name="l03297"></a><span class="lineno"> 3297</span>&#160;    MOUSEHOOKSTRUCT mhs;</div>
<div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndT;</div>
<div class="line"><a name="l03299"></a><span class="lineno"> 3299</span>&#160;    BOOL fPrevDown;</div>
<div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>&#160;    BOOL fDown;</div>
<div class="line"><a name="l03301"></a><span class="lineno"> 3301</span>&#160;    BOOL fAlt;</div>
<div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> <a class="code" href="a00377.html#af1128a676756d86f949094178c96d93b">key</a>;</div>
<div class="line"><a name="l03303"></a><span class="lineno"> 3303</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwnd;</div>
<div class="line"><a name="l03304"></a><span class="lineno"> 3304</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndT;</div>
<div class="line"><a name="l03305"></a><span class="lineno"> 3305</span>&#160;    BOOL fRemove = (flags &amp; PM_REMOVE);</div>
<div class="line"><a name="l03306"></a><span class="lineno"> 3306</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndMouse;</div>
<div class="line"><a name="l03307"></a><span class="lineno"> 3307</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l03308"></a><span class="lineno"> 3308</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwImmRet = 0;</div>
<div class="line"><a name="l03309"></a><span class="lineno"> 3309</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l03310"></a><span class="lineno"> 3310</span>&#160;<span class="preprocessor">#ifdef MARKPATH</span></div>
<div class="line"><a name="l03311"></a><span class="lineno"> 3311</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> pathTaken = 0;</div>
<div class="line"><a name="l03312"></a><span class="lineno"> 3312</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> pathTaken2 = 0;</div>
<div class="line"><a name="l03313"></a><span class="lineno"> 3313</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> pathTaken3 = 0;</div>
<div class="line"><a name="l03314"></a><span class="lineno"> 3314</span>&#160; </div>
<div class="line"><a name="l03315"></a><span class="lineno"> 3315</span>&#160;<span class="preprocessor">#define PATHTAKEN(x)  pathTaken  |= x</span></div>
<div class="line"><a name="l03316"></a><span class="lineno"> 3316</span>&#160;<span class="preprocessor">#define PATHTAKEN2(x) pathTaken2 |= x</span></div>
<div class="line"><a name="l03317"></a><span class="lineno"> 3317</span>&#160;<span class="preprocessor">#define PATHTAKEN3(x) pathTaken3 |= x</span></div>
<div class="line"><a name="l03318"></a><span class="lineno"> 3318</span>&#160;<span class="preprocessor">#define DUMPPATHTAKEN() if (gfMarkPath) DbgPrint(&quot;xxxScanSysQueue path:%08x %08x %08x\n&quot;, pathTaken, pathTaken2, pathTaken3)</span></div>
<div class="line"><a name="l03319"></a><span class="lineno"> 3319</span>&#160;<span class="preprocessor">#define DUMPSUBPATHTAKEN(p, x) if (gfMarkPath &amp;&amp; p &amp; x) { DbgPrint(&quot;  %08x %08x %08x\n&quot;, pathTaken, pathTaken2, pathTaken3); pathTaken = pathTaken2 = pathTaken3 = 0; }</span></div>
<div class="line"><a name="l03320"></a><span class="lineno"> 3320</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l03321"></a><span class="lineno"> 3321</span>&#160;<span class="preprocessor">#define PATHTAKEN(x)</span></div>
<div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>&#160;<span class="preprocessor">#define PATHTAKEN2(x)</span></div>
<div class="line"><a name="l03323"></a><span class="lineno"> 3323</span>&#160;<span class="preprocessor">#define PATHTAKEN3(x)</span></div>
<div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>&#160;<span class="preprocessor">#define DUMPPATHTAKEN()</span></div>
<div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>&#160;<span class="preprocessor">#define DUMPSUBPATHTAKEN(p, x)</span></div>
<div class="line"><a name="l03326"></a><span class="lineno"> 3326</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>&#160; </div>
<div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>((fsReason &amp; ~(QS_EVENT | QS_INPUT)) == 0 &amp;&amp;</div>
<div class="line"><a name="l03329"></a><span class="lineno"> 3329</span>&#160;               (fsReason &amp; (QS_EVENT | QS_INPUT)) != 0);</div>
<div class="line"><a name="l03330"></a><span class="lineno"> 3330</span>&#160; </div>
<div class="line"><a name="l03331"></a><span class="lineno"> 3331</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03332"></a><span class="lineno"> 3332</span>&#160;<span class="comment">     * If we are looking at a peeked message currently (recursion into this</span></div>
<div class="line"><a name="l03333"></a><span class="lineno"> 3333</span>&#160;<span class="comment">     * routine) and the only reason we got here was because of an event</span></div>
<div class="line"><a name="l03334"></a><span class="lineno"> 3334</span>&#160;<span class="comment">     * message (an app was filtering for a non-input message), then just</span></div>
<div class="line"><a name="l03335"></a><span class="lineno"> 3335</span>&#160;<span class="comment">     * return so we don&#39;t screw up idSysPeek. If we do enter this code</span></div>
<div class="line"><a name="l03336"></a><span class="lineno"> 3336</span>&#160;<span class="comment">     * idSysPeek will get set back to 0, and when we return back into</span></div>
<div class="line"><a name="l03337"></a><span class="lineno"> 3337</span>&#160;<span class="comment">     * the previous xxxScanSysQueue(), SkipSysMsg() will do nothing, so the</span></div>
<div class="line"><a name="l03338"></a><span class="lineno"> 3338</span>&#160;<span class="comment">     * message won&#39;t get removed. (MS Publisher 2.0 does this).</span></div>
<div class="line"><a name="l03339"></a><span class="lineno"> 3339</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>&#160;    <span class="keywordflow">if</span> (fsReason == QS_EVENT) {</div>
<div class="line"><a name="l03341"></a><span class="lineno"> 3341</span>&#160;        <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> != 0) {</div>
<div class="line"><a name="l03342"></a><span class="lineno"> 3342</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(1);</div>
<div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>&#160;            <a class="code" href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a>();</div>
<div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>&#160;        }</div>
<div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>&#160;    }</div>
<div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>&#160; </div>
<div class="line"><a name="l03348"></a><span class="lineno"> 3348</span>&#160;    fDown = FALSE;</div>
<div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>&#160;    fMouseHookCalled = FALSE;</div>
<div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>&#160;    fKbdHookCalled = FALSE;</div>
<div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>&#160; </div>
<div class="line"><a name="l03352"></a><span class="lineno"> 3352</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03353"></a><span class="lineno"> 3353</span>&#160;<span class="comment">     * Lock the queue if it&#39;s currently unlocked.</span></div>
<div class="line"><a name="l03354"></a><span class="lineno"> 3354</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03355"></a><span class="lineno"> 3355</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> == NULL) {</div>
<div class="line"><a name="l03356"></a><span class="lineno"> 3356</span>&#160;        <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(3, ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, ptiCurrent);</div>
<div class="line"><a name="l03357"></a><span class="lineno"> 3357</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = ptiCurrent;</div>
<div class="line"><a name="l03358"></a><span class="lineno"> 3358</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a51167c8ff7f1cc33e44ee9777e1016c9">CTIF_flags</a> |= CTIF_SYSQUEUELOCKED;</div>
<div class="line"><a name="l03359"></a><span class="lineno"> 3359</span>&#160;    }</div>
<div class="line"><a name="l03360"></a><span class="lineno"> 3360</span>&#160; </div>
<div class="line"><a name="l03361"></a><span class="lineno"> 3361</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03362"></a><span class="lineno"> 3362</span>&#160;<span class="comment">     * Flag to tell if locker was removing messages. If not, then next time</span></div>
<div class="line"><a name="l03363"></a><span class="lineno"> 3363</span>&#160;<span class="comment">     * Get/PeekMessage is called, the input message list is scanned before the</span></div>
<div class="line"><a name="l03364"></a><span class="lineno"> 3364</span>&#160;<span class="comment">     * post msg list.</span></div>
<div class="line"><a name="l03365"></a><span class="lineno"> 3365</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l03366"></a><span class="lineno"> 3366</span>&#160;<span class="comment">     * Under Win3.1, this flag only gets modified for key and mouse messages.</span></div>
<div class="line"><a name="l03367"></a><span class="lineno"> 3367</span>&#160;<span class="comment">     * Since under NT ScanSysQueue() can be called to execute event messages,</span></div>
<div class="line"><a name="l03368"></a><span class="lineno"> 3368</span>&#160;<span class="comment">     * we make this check to be compatible.</span></div>
<div class="line"><a name="l03369"></a><span class="lineno"> 3369</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03370"></a><span class="lineno"> 3370</span>&#160;    <span class="keywordflow">if</span> (fsReason &amp; QS_INPUT) {</div>
<div class="line"><a name="l03371"></a><span class="lineno"> 3371</span>&#160;        <span class="keywordflow">if</span> (fRemove) {</div>
<div class="line"><a name="l03372"></a><span class="lineno"> 3372</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(2);</div>
<div class="line"><a name="l03373"></a><span class="lineno"> 3373</span>&#160;            ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_LOCKNOREMOVE;</div>
<div class="line"><a name="l03374"></a><span class="lineno"> 3374</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03375"></a><span class="lineno"> 3375</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(4);</div>
<div class="line"><a name="l03376"></a><span class="lineno"> 3376</span>&#160;            ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_LOCKNOREMOVE;</div>
<div class="line"><a name="l03377"></a><span class="lineno"> 3377</span>&#160;        }</div>
<div class="line"><a name="l03378"></a><span class="lineno"> 3378</span>&#160;    }</div>
<div class="line"><a name="l03379"></a><span class="lineno"> 3379</span>&#160; </div>
<div class="line"><a name="l03380"></a><span class="lineno"> 3380</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03381"></a><span class="lineno"> 3381</span>&#160;<span class="comment">     * Return FALSE if the current thread is not the one that lock this queue.</span></div>
<div class="line"><a name="l03382"></a><span class="lineno"> 3382</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03383"></a><span class="lineno"> 3383</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> != ptiCurrent) {</div>
<div class="line"><a name="l03384"></a><span class="lineno"> 3384</span>&#160;        <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(8);</div>
<div class="line"><a name="l03385"></a><span class="lineno"> 3385</span>&#160;        <a class="code" href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a>();</div>
<div class="line"><a name="l03386"></a><span class="lineno"> 3386</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03387"></a><span class="lineno"> 3387</span>&#160;    }</div>
<div class="line"><a name="l03388"></a><span class="lineno"> 3388</span>&#160; </div>
<div class="line"><a name="l03389"></a><span class="lineno"> 3389</span>&#160;    ptiEventWake = ptiKeyWake = ptiMouseWake = NULL;</div>
<div class="line"><a name="l03390"></a><span class="lineno"> 3390</span>&#160; </div>
<div class="line"><a name="l03391"></a><span class="lineno"> 3391</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03392"></a><span class="lineno"> 3392</span>&#160;<span class="comment">     * Initialize the thread lock structure here so we can unlock/lock in</span></div>
<div class="line"><a name="l03393"></a><span class="lineno"> 3393</span>&#160;<span class="comment">     * the main loop.</span></div>
<div class="line"><a name="l03394"></a><span class="lineno"> 3394</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03395"></a><span class="lineno"> 3395</span>&#160;    pwnd = NULL;</div>
<div class="line"><a name="l03396"></a><span class="lineno"> 3396</span>&#160;    ThreadLockWithPti(ptiCurrent, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l03397"></a><span class="lineno"> 3397</span>&#160; </div>
<div class="line"><a name="l03398"></a><span class="lineno"> 3398</span>&#160;RestartScan:</div>
<div class="line"><a name="l03399"></a><span class="lineno"> 3399</span>&#160;    <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(2, ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, 0);</div>
<div class="line"><a name="l03400"></a><span class="lineno"> 3400</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l03401"></a><span class="lineno"> 3401</span>&#160; </div>
<div class="line"><a name="l03402"></a><span class="lineno"> 3402</span>&#160;ContinueScan:</div>
<div class="line"><a name="l03403"></a><span class="lineno"> 3403</span>&#160;    <span class="keywordflow">while</span> (TRUE) {</div>
<div class="line"><a name="l03404"></a><span class="lineno"> 3404</span>&#160;        <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idSysPeek;</div>
<div class="line"><a name="l03405"></a><span class="lineno"> 3405</span>&#160; </div>
<div class="line"><a name="l03406"></a><span class="lineno"> 3406</span>&#160;        <a class="code" href="a03290.html#a4a3403c63c49e44a7fa551d0d6f475b0">DUMPSUBPATHTAKEN</a>(pathTaken, 0xf0);</div>
<div class="line"><a name="l03407"></a><span class="lineno"> 3407</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03408"></a><span class="lineno"> 3408</span>&#160;<span class="comment">         * Store idSysPeek in a local which forces pq to be reloaded</span></div>
<div class="line"><a name="l03409"></a><span class="lineno"> 3409</span>&#160;<span class="comment">         * in case it changed during the xxx call (the compiler can</span></div>
<div class="line"><a name="l03410"></a><span class="lineno"> 3410</span>&#160;<span class="comment">         * evaluate the LValue at any time)</span></div>
<div class="line"><a name="l03411"></a><span class="lineno"> 3411</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03412"></a><span class="lineno"> 3412</span>&#160;        idSysPeek = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)<a class="code" href="a03290.html#a7cda2eaad1e3b8c5412b982d5b64fdfe">xxxGetNextSysMsg</a>(ptiCurrent,</div>
<div class="line"><a name="l03413"></a><span class="lineno"> 3413</span>&#160;                (<a class="code" href="a02857.html">PQMSG</a>)ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>, &amp;qmsg);</div>
<div class="line"><a name="l03414"></a><span class="lineno"> 3414</span>&#160;        <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(3, ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, idSysPeek);</div>
<div class="line"><a name="l03415"></a><span class="lineno"> 3415</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = idSysPeek;</div>
<div class="line"><a name="l03416"></a><span class="lineno"> 3416</span>&#160; </div>
<div class="line"><a name="l03417"></a><span class="lineno"> 3417</span>&#160;        <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> == 0) {</div>
<div class="line"><a name="l03418"></a><span class="lineno"> 3418</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03419"></a><span class="lineno"> 3419</span>&#160;<span class="comment">             * If we are only looking for event messages and we didn&#39;t</span></div>
<div class="line"><a name="l03420"></a><span class="lineno"> 3420</span>&#160;<span class="comment">             * find any, then clear the QS_EVENT bit</span></div>
<div class="line"><a name="l03421"></a><span class="lineno"> 3421</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03422"></a><span class="lineno"> 3422</span>&#160;            <span class="keywordflow">if</span> (fsReason == QS_EVENT)</div>
<div class="line"><a name="l03423"></a><span class="lineno"> 3423</span>&#160;                <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_EVENT, FALSE);</div>
<div class="line"><a name="l03424"></a><span class="lineno"> 3424</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x10);</div>
<div class="line"><a name="l03425"></a><span class="lineno"> 3425</span>&#160;            <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>&#160;        }</div>
<div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>&#160; </div>
<div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>&#160;<span class="comment">         * pwnd should be locked for the duration of this routine.</span></div>
<div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>&#160;<span class="comment">         * For most messages right out of GetNextSysMsg, this is</span></div>
<div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>&#160;<span class="comment">         * NULL.</span></div>
<div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03433"></a><span class="lineno"> 3433</span>&#160;        ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l03434"></a><span class="lineno"> 3434</span>&#160;        pwnd = RevalidateHwnd(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd);</div>
<div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>&#160;        ThreadLockWithPti(ptiCurrent, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>&#160; </div>
<div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>&#160;<span class="comment">         * See if this is an event message. If so, execute it regardless</span></div>
<div class="line"><a name="l03439"></a><span class="lineno"> 3439</span>&#160;<span class="comment">         * of message and window filters, but only if it is the first element</span></div>
<div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>&#160;<span class="comment">         * of the input queue.</span></div>
<div class="line"><a name="l03441"></a><span class="lineno"> 3441</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>&#160;        <span class="keywordflow">if</span> (qmsg.<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a> != 0) {</div>
<div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>&#160;            <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>&#160; </div>
<div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x20);</div>
<div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03447"></a><span class="lineno"> 3447</span>&#160;<span class="comment">             * Most event messages can be executed out of order relative to</span></div>
<div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>&#160;<span class="comment">             * its place in the queue. There are some examples were this is</span></div>
<div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>&#160;<span class="comment">             * not allowed, and we check that here. For example, we would not</span></div>
<div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>&#160;<span class="comment">             * want a keystate synchronization event to be processed before</span></div>
<div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>&#160;<span class="comment">             * the keystrokes that came before it in the queue!</span></div>
<div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>&#160;<span class="comment">             *</span></div>
<div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>&#160;<span class="comment">             * We need to have most event messages be able to get processed</span></div>
<div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>&#160;<span class="comment">             * out of order because apps can be filtering for message ranges</span></div>
<div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>&#160;<span class="comment">             * that don&#39;t include input (like dde) - those scenarios still</span></div>
<div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>&#160;<span class="comment">             * need to process events such as deactivate event messages even</span></div>
<div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>&#160;<span class="comment">             * if there is input in the input queue.</span></div>
<div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>&#160;            <span class="keywordflow">switch</span> (qmsg.<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a>) {</div>
<div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>&#160;            <span class="keywordflow">case</span> QEVENT_UPDATEKEYSTATE:</div>
<div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>&#160;<span class="comment">                 * If the message is not the next message in the queue, don&#39;t</span></div>
<div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>&#160;<span class="comment">                 * process it.</span></div>
<div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>&#160;                <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> !=</div>
<div class="line"><a name="l03466"></a><span class="lineno"> 3466</span>&#160;                        (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>) {</div>
<div class="line"><a name="l03467"></a><span class="lineno"> 3467</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x40);</div>
<div class="line"><a name="l03468"></a><span class="lineno"> 3468</span>&#160;                    <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03469"></a><span class="lineno"> 3469</span>&#160;                }</div>
<div class="line"><a name="l03470"></a><span class="lineno"> 3470</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03471"></a><span class="lineno"> 3471</span>&#160;            }</div>
<div class="line"><a name="l03472"></a><span class="lineno"> 3472</span>&#160; </div>
<div class="line"><a name="l03473"></a><span class="lineno"> 3473</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03474"></a><span class="lineno"> 3474</span>&#160;<span class="comment">             * If this event isn&#39;t for this thread, wake the thread it is</span></div>
<div class="line"><a name="l03475"></a><span class="lineno"> 3475</span>&#160;<span class="comment">             * for.  A NULL qmsg.hti means that any thread can process</span></div>
<div class="line"><a name="l03476"></a><span class="lineno"> 3476</span>&#160;<span class="comment">             * the event.</span></div>
<div class="line"><a name="l03477"></a><span class="lineno"> 3477</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03478"></a><span class="lineno"> 3478</span>&#160;            <span class="keywordflow">if</span> (qmsg.<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> != NULL &amp;&amp; (pti = qmsg.<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>) != ptiCurrent) {</div>
<div class="line"><a name="l03479"></a><span class="lineno"> 3479</span>&#160; </div>
<div class="line"><a name="l03480"></a><span class="lineno"> 3480</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03481"></a><span class="lineno"> 3481</span>&#160;<span class="comment">                 * If somehow this event message got into the wrong queue,</span></div>
<div class="line"><a name="l03482"></a><span class="lineno"> 3482</span>&#160;<span class="comment">                 * then ignore it.</span></div>
<div class="line"><a name="l03483"></a><span class="lineno"> 3483</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03484"></a><span class="lineno"> 3484</span>&#160;                <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> == ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>);</div>
<div class="line"><a name="l03485"></a><span class="lineno"> 3485</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> != ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) {</div>
<div class="line"><a name="l03486"></a><span class="lineno"> 3486</span>&#160;                    <a class="code" href="a03290.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a>((<a class="code" href="a02857.html">PQMSG</a>)ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>);</div>
<div class="line"><a name="l03487"></a><span class="lineno"> 3487</span>&#160;                    <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(&amp;ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>,</div>
<div class="line"><a name="l03488"></a><span class="lineno"> 3488</span>&#160;                            (<a class="code" href="a02857.html">PQMSG</a>)ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>);</div>
<div class="line"><a name="l03489"></a><span class="lineno"> 3489</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x80);</div>
<div class="line"><a name="l03490"></a><span class="lineno"> 3490</span>&#160;                    <span class="keywordflow">goto</span> RestartScan;</div>
<div class="line"><a name="l03491"></a><span class="lineno"> 3491</span>&#160;                }</div>
<div class="line"><a name="l03492"></a><span class="lineno"> 3492</span>&#160; </div>
<div class="line"><a name="l03493"></a><span class="lineno"> 3493</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03494"></a><span class="lineno"> 3494</span>&#160;<span class="comment">                 * If ptiEventWake is already set, it means we&#39;ve already</span></div>
<div class="line"><a name="l03495"></a><span class="lineno"> 3495</span>&#160;<span class="comment">                 * found a thread to wake for event.</span></div>
<div class="line"><a name="l03496"></a><span class="lineno"> 3496</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03497"></a><span class="lineno"> 3497</span>&#160;                <span class="keywordflow">if</span> (ptiEventWake == NULL)</div>
<div class="line"><a name="l03498"></a><span class="lineno"> 3498</span>&#160;                    ptiEventWake = pti;</div>
<div class="line"><a name="l03499"></a><span class="lineno"> 3499</span>&#160; </div>
<div class="line"><a name="l03500"></a><span class="lineno"> 3500</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03501"></a><span class="lineno"> 3501</span>&#160;<span class="comment">                 * Clear idSysPeek so that the targeted thread</span></div>
<div class="line"><a name="l03502"></a><span class="lineno"> 3502</span>&#160;<span class="comment">                 * can always get it.  Look at the test at the</span></div>
<div class="line"><a name="l03503"></a><span class="lineno"> 3503</span>&#160;<span class="comment">                 * start of this routine for more info.</span></div>
<div class="line"><a name="l03504"></a><span class="lineno"> 3504</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03505"></a><span class="lineno"> 3505</span>&#160;                <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(4, ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, 0);</div>
<div class="line"><a name="l03506"></a><span class="lineno"> 3506</span>&#160;                ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l03507"></a><span class="lineno"> 3507</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x100);</div>
<div class="line"><a name="l03508"></a><span class="lineno"> 3508</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l03509"></a><span class="lineno"> 3509</span>&#160;            }</div>
<div class="line"><a name="l03510"></a><span class="lineno"> 3510</span>&#160; </div>
<div class="line"><a name="l03511"></a><span class="lineno"> 3511</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03512"></a><span class="lineno"> 3512</span>&#160;<span class="comment">             * If this is called with PM_NOYIELD from a 16-bit app, skip</span></div>
<div class="line"><a name="l03513"></a><span class="lineno"> 3513</span>&#160;<span class="comment">             * processing any event that can generate activation messages.  An</span></div>
<div class="line"><a name="l03514"></a><span class="lineno"> 3514</span>&#160;<span class="comment">             * example is printing from PageMaker 5.0.  Bug #12662.</span></div>
<div class="line"><a name="l03515"></a><span class="lineno"> 3515</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03516"></a><span class="lineno"> 3516</span>&#160;            <span class="keywordflow">if</span> ((flags &amp; PM_NOYIELD) &amp;&amp; (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT)) {</div>
<div class="line"><a name="l03517"></a><span class="lineno"> 3517</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x200);</div>
<div class="line"><a name="l03518"></a><span class="lineno"> 3518</span>&#160;                <span class="keywordflow">switch</span> (qmsg.<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a>) {</div>
<div class="line"><a name="l03519"></a><span class="lineno"> 3519</span>&#160; </div>
<div class="line"><a name="l03520"></a><span class="lineno"> 3520</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03521"></a><span class="lineno"> 3521</span>&#160;<span class="comment">                 * The following events are safe to process if no yield</span></div>
<div class="line"><a name="l03522"></a><span class="lineno"> 3522</span>&#160;<span class="comment">                 * is to occur.</span></div>
<div class="line"><a name="l03523"></a><span class="lineno"> 3523</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03524"></a><span class="lineno"> 3524</span>&#160;                <span class="keywordflow">case</span> QEVENT_UPDATEKEYSTATE:</div>
<div class="line"><a name="l03525"></a><span class="lineno"> 3525</span>&#160;                <span class="keywordflow">case</span> QEVENT_ASYNCSENDMSG:</div>
<div class="line"><a name="l03526"></a><span class="lineno"> 3526</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03527"></a><span class="lineno"> 3527</span>&#160; </div>
<div class="line"><a name="l03528"></a><span class="lineno"> 3528</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03529"></a><span class="lineno"> 3529</span>&#160;<span class="comment">                 * Skip all other events.</span></div>
<div class="line"><a name="l03530"></a><span class="lineno"> 3530</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03531"></a><span class="lineno"> 3531</span>&#160;                <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l03532"></a><span class="lineno"> 3532</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_DELAYEDEVENT;</div>
<div class="line"><a name="l03533"></a><span class="lineno"> 3533</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x400);</div>
<div class="line"><a name="l03534"></a><span class="lineno"> 3534</span>&#160;                    <span class="keywordflow">goto</span> ContinueScan;</div>
<div class="line"><a name="l03535"></a><span class="lineno"> 3535</span>&#160;                }</div>
<div class="line"><a name="l03536"></a><span class="lineno"> 3536</span>&#160;            }</div>
<div class="line"><a name="l03537"></a><span class="lineno"> 3537</span>&#160; </div>
<div class="line"><a name="l03538"></a><span class="lineno"> 3538</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03539"></a><span class="lineno"> 3539</span>&#160;<span class="comment">             * Delete this before it gets processed so there are no</span></div>
<div class="line"><a name="l03540"></a><span class="lineno"> 3540</span>&#160;<span class="comment">             * recursion problems.</span></div>
<div class="line"><a name="l03541"></a><span class="lineno"> 3541</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03542"></a><span class="lineno"> 3542</span>&#160;            <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(&amp;ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>,</div>
<div class="line"><a name="l03543"></a><span class="lineno"> 3543</span>&#160;                    (<a class="code" href="a02857.html">PQMSG</a>)ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>);</div>
<div class="line"><a name="l03544"></a><span class="lineno"> 3544</span>&#160; </div>
<div class="line"><a name="l03545"></a><span class="lineno"> 3545</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03546"></a><span class="lineno"> 3546</span>&#160;<span class="comment">             * Clear idSysPeek before processing any events messages, because</span></div>
<div class="line"><a name="l03547"></a><span class="lineno"> 3547</span>&#160;<span class="comment">             * they may recurse and want to use idSysPeek.</span></div>
<div class="line"><a name="l03548"></a><span class="lineno"> 3548</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03549"></a><span class="lineno"> 3549</span>&#160;            <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(5, ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, 0);</div>
<div class="line"><a name="l03550"></a><span class="lineno"> 3550</span>&#160;            ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l03551"></a><span class="lineno"> 3551</span>&#160;            <a class="code" href="a00824.html#ae98d2a9cd72776c2a573809d347a8366">xxxProcessEventMessage</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l03552"></a><span class="lineno"> 3552</span>&#160; </div>
<div class="line"><a name="l03553"></a><span class="lineno"> 3553</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03554"></a><span class="lineno"> 3554</span>&#160;<span class="comment">             * Restart the scan from the start so we start with 0 in</span></div>
<div class="line"><a name="l03555"></a><span class="lineno"> 3555</span>&#160;<span class="comment">             * pq-&gt;idSysPeek (since that message is now gone!).</span></div>
<div class="line"><a name="l03556"></a><span class="lineno"> 3556</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03557"></a><span class="lineno"> 3557</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x800);</div>
<div class="line"><a name="l03558"></a><span class="lineno"> 3558</span>&#160;            <span class="keywordflow">goto</span> RestartScan;</div>
<div class="line"><a name="l03559"></a><span class="lineno"> 3559</span>&#160;        }</div>
<div class="line"><a name="l03560"></a><span class="lineno"> 3560</span>&#160; </div>
<div class="line"><a name="l03561"></a><span class="lineno"> 3561</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03562"></a><span class="lineno"> 3562</span>&#160;<span class="comment">         * If the reason we called was just to process event messages, don&#39;t</span></div>
<div class="line"><a name="l03563"></a><span class="lineno"> 3563</span>&#160;<span class="comment">         * enumerate any other mouse or key messages!</span></div>
<div class="line"><a name="l03564"></a><span class="lineno"> 3564</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03565"></a><span class="lineno"> 3565</span>&#160;        <span class="keywordflow">if</span> (fsReason == QS_EVENT) {</div>
<div class="line"><a name="l03566"></a><span class="lineno"> 3566</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x1000);</div>
<div class="line"><a name="l03567"></a><span class="lineno"> 3567</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03568"></a><span class="lineno"> 3568</span>&#160;        }</div>
<div class="line"><a name="l03569"></a><span class="lineno"> 3569</span>&#160; </div>
<div class="line"><a name="l03570"></a><span class="lineno"> 3570</span>&#160;        <span class="keywordflow">switch</span> (message = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message) {</div>
<div class="line"><a name="l03571"></a><span class="lineno"> 3571</span>&#160;        <span class="keywordflow">case</span> WM_QUEUESYNC:</div>
<div class="line"><a name="l03572"></a><span class="lineno"> 3572</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x2000);</div>
<div class="line"><a name="l03573"></a><span class="lineno"> 3573</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03574"></a><span class="lineno"> 3574</span>&#160;<span class="comment">             * This message is for CBT. Its parameters should already be</span></div>
<div class="line"><a name="l03575"></a><span class="lineno"> 3575</span>&#160;<span class="comment">             * set up correctly.</span></div>
<div class="line"><a name="l03576"></a><span class="lineno"> 3576</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03577"></a><span class="lineno"> 3577</span>&#160;            wParam = 0;</div>
<div class="line"><a name="l03578"></a><span class="lineno"> 3578</span>&#160;            lParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam;</div>
<div class="line"><a name="l03579"></a><span class="lineno"> 3579</span>&#160; </div>
<div class="line"><a name="l03580"></a><span class="lineno"> 3580</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03581"></a><span class="lineno"> 3581</span>&#160;<span class="comment">             * Check if this is intended for the current app. Use the mouse</span></div>
<div class="line"><a name="l03582"></a><span class="lineno"> 3582</span>&#160;<span class="comment">             * bit for WM_QUEUESYNC.</span></div>
<div class="line"><a name="l03583"></a><span class="lineno"> 3583</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03584"></a><span class="lineno"> 3584</span>&#160;            <span class="keywordflow">if</span> (pwnd != NULL &amp;&amp; GETPTI(pwnd) != ptiCurrent) {</div>
<div class="line"><a name="l03585"></a><span class="lineno"> 3585</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03586"></a><span class="lineno"> 3586</span>&#160;<span class="comment">                 * If this other app isn&#39;t going to read from this</span></div>
<div class="line"><a name="l03587"></a><span class="lineno"> 3587</span>&#160;<span class="comment">                 * queue, then skip this message. This can happen with</span></div>
<div class="line"><a name="l03588"></a><span class="lineno"> 3588</span>&#160;<span class="comment">                 * WM_QUEUESYNC if the app passed a window handle</span></div>
<div class="line"><a name="l03589"></a><span class="lineno"> 3589</span>&#160;<span class="comment">                 * to the wrong queue. This isn&#39;t likely to happen in</span></div>
<div class="line"><a name="l03590"></a><span class="lineno"> 3590</span>&#160;<span class="comment">                 * this case because WM_QUEUESYNCs come in while journalling,</span></div>
<div class="line"><a name="l03591"></a><span class="lineno"> 3591</span>&#160;<span class="comment">                 * which has all threads sharing the same queue.</span></div>
<div class="line"><a name="l03592"></a><span class="lineno"> 3592</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03593"></a><span class="lineno"> 3593</span>&#160;                <span class="keywordflow">if</span> (GETPTI(pwnd)-&gt;pq != ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) {</div>
<div class="line"><a name="l03594"></a><span class="lineno"> 3594</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x4000);</div>
<div class="line"><a name="l03595"></a><span class="lineno"> 3595</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l03596"></a><span class="lineno"> 3596</span>&#160;                }</div>
<div class="line"><a name="l03597"></a><span class="lineno"> 3597</span>&#160; </div>
<div class="line"><a name="l03598"></a><span class="lineno"> 3598</span>&#160;                <span class="keywordflow">if</span> (ptiMouseWake == NULL)</div>
<div class="line"><a name="l03599"></a><span class="lineno"> 3599</span>&#160;                    ptiMouseWake = GETPTI(pwnd);</div>
<div class="line"><a name="l03600"></a><span class="lineno"> 3600</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x8000);</div>
<div class="line"><a name="l03601"></a><span class="lineno"> 3601</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l03602"></a><span class="lineno"> 3602</span>&#160;            }</div>
<div class="line"><a name="l03603"></a><span class="lineno"> 3603</span>&#160; </div>
<div class="line"><a name="l03604"></a><span class="lineno"> 3604</span>&#160;            <span class="keywordflow">if</span> (!CheckMsgFilter(message, msgMinFilter, msgMaxFilter)) {</div>
<div class="line"><a name="l03605"></a><span class="lineno"> 3605</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x10000);</div>
<div class="line"><a name="l03606"></a><span class="lineno"> 3606</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l03607"></a><span class="lineno"> 3607</span>&#160;            }</div>
<div class="line"><a name="l03608"></a><span class="lineno"> 3608</span>&#160; </div>
<div class="line"><a name="l03609"></a><span class="lineno"> 3609</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03610"></a><span class="lineno"> 3610</span>&#160;<span class="comment">             * Eat the message.</span></div>
<div class="line"><a name="l03611"></a><span class="lineno"> 3611</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03612"></a><span class="lineno"> 3612</span>&#160;            <span class="keywordflow">if</span> (fRemove) {</div>
<div class="line"><a name="l03613"></a><span class="lineno"> 3613</span>&#160;                <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l03614"></a><span class="lineno"> 3614</span>&#160;            }</div>
<div class="line"><a name="l03615"></a><span class="lineno"> 3615</span>&#160; </div>
<div class="line"><a name="l03616"></a><span class="lineno"> 3616</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03617"></a><span class="lineno"> 3617</span>&#160;<span class="comment">             * !!HARDWARE HOOK!! goes here.</span></div>
<div class="line"><a name="l03618"></a><span class="lineno"> 3618</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03619"></a><span class="lineno"> 3619</span>&#160; </div>
<div class="line"><a name="l03620"></a><span class="lineno"> 3620</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03621"></a><span class="lineno"> 3621</span>&#160;<span class="comment">             * Return the message.</span></div>
<div class="line"><a name="l03622"></a><span class="lineno"> 3622</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03623"></a><span class="lineno"> 3623</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x20000);</div>
<div class="line"><a name="l03624"></a><span class="lineno"> 3624</span>&#160;            <span class="keywordflow">goto</span> ReturnMessage;</div>
<div class="line"><a name="l03625"></a><span class="lineno"> 3625</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03626"></a><span class="lineno"> 3626</span>&#160; </div>
<div class="line"><a name="l03627"></a><span class="lineno"> 3627</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03628"></a><span class="lineno"> 3628</span>&#160;<span class="comment">         * Mouse message or generic hardware messages</span></div>
<div class="line"><a name="l03629"></a><span class="lineno"> 3629</span>&#160;<span class="comment">         * Key messages are handled in case statements</span></div>
<div class="line"><a name="l03630"></a><span class="lineno"> 3630</span>&#160;<span class="comment">         * further down in this switch.</span></div>
<div class="line"><a name="l03631"></a><span class="lineno"> 3631</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03632"></a><span class="lineno"> 3632</span>&#160;        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l03633"></a><span class="lineno"> 3633</span>&#160;ReprocessMsg:</div>
<div class="line"><a name="l03634"></a><span class="lineno"> 3634</span>&#160;            <a class="code" href="a03290.html#a4a3403c63c49e44a7fa551d0d6f475b0">DUMPSUBPATHTAKEN</a>(pathTaken, 0x40000);</div>
<div class="line"><a name="l03635"></a><span class="lineno"> 3635</span>&#160;            <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x40000);</div>
<div class="line"><a name="l03636"></a><span class="lineno"> 3636</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03637"></a><span class="lineno"> 3637</span>&#160;<span class="comment">             * !!GENERIC HARDWARE MESSAGE!! support goes here.</span></div>
<div class="line"><a name="l03638"></a><span class="lineno"> 3638</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03639"></a><span class="lineno"> 3639</span>&#160; </div>
<div class="line"><a name="l03640"></a><span class="lineno"> 3640</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03641"></a><span class="lineno"> 3641</span>&#160;<span class="comment">             * Take the mouse position out of the message.</span></div>
<div class="line"><a name="l03642"></a><span class="lineno"> 3642</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03643"></a><span class="lineno"> 3643</span>&#160;            pt.x = (int)(<span class="keywordtype">short</span>)LOWORD(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam);</div>
<div class="line"><a name="l03644"></a><span class="lineno"> 3644</span>&#160;            pt.y = (int)(<span class="keywordtype">short</span>)HIWORD(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam);</div>
<div class="line"><a name="l03645"></a><span class="lineno"> 3645</span>&#160; </div>
<div class="line"><a name="l03646"></a><span class="lineno"> 3646</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03647"></a><span class="lineno"> 3647</span>&#160;<span class="comment">             * Assume we have a capture.</span></div>
<div class="line"><a name="l03648"></a><span class="lineno"> 3648</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03649"></a><span class="lineno"> 3649</span>&#160;            part = HTCLIENT;</div>
<div class="line"><a name="l03650"></a><span class="lineno"> 3650</span>&#160; </div>
<div class="line"><a name="l03651"></a><span class="lineno"> 3651</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03652"></a><span class="lineno"> 3652</span>&#160;<span class="comment">             * We have a special global we use for when we&#39;re full screen.</span></div>
<div class="line"><a name="l03653"></a><span class="lineno"> 3653</span>&#160;<span class="comment">             * All mouse input will go to this window.</span></div>
<div class="line"><a name="l03654"></a><span class="lineno"> 3654</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03655"></a><span class="lineno"> 3655</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a66d75018ac18b148273ed2f14fd0e186">gspwndScreenCapture</a> != NULL) {</div>
<div class="line"><a name="l03656"></a><span class="lineno"> 3656</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03657"></a><span class="lineno"> 3657</span>&#160;<span class="comment">                 * Change the mouse coordinates to full screen.</span></div>
<div class="line"><a name="l03658"></a><span class="lineno"> 3658</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03659"></a><span class="lineno"> 3659</span>&#160;                pwnd = <a class="code" href="a03257.html#a66d75018ac18b148273ed2f14fd0e186">gspwndScreenCapture</a>;</div>
<div class="line"><a name="l03660"></a><span class="lineno"> 3660</span>&#160;                lParam = MAKELONG((WORD)qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt.x,</div>
<div class="line"><a name="l03661"></a><span class="lineno"> 3661</span>&#160;                        (WORD)qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt.y);</div>
<div class="line"><a name="l03662"></a><span class="lineno"> 3662</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x80000);</div>
<div class="line"><a name="l03663"></a><span class="lineno"> 3663</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>) == NULL) {</div>
<div class="line"><a name="l03664"></a><span class="lineno"> 3664</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x100000);</div>
<div class="line"><a name="l03665"></a><span class="lineno"> 3665</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03666"></a><span class="lineno"> 3666</span>&#160;<span class="comment">                 * We don&#39;t have the capture. Figure out which window owns</span></div>
<div class="line"><a name="l03667"></a><span class="lineno"> 3667</span>&#160;<span class="comment">                 * this message.</span></div>
<div class="line"><a name="l03668"></a><span class="lineno"> 3668</span>&#160;<span class="comment">                 *</span></div>
<div class="line"><a name="l03669"></a><span class="lineno"> 3669</span>&#160;<span class="comment">                 * NOTE: Use gptiRit and not ptiCurrent to get the desktop</span></div>
<div class="line"><a name="l03670"></a><span class="lineno"> 3670</span>&#160;<span class="comment">                 * window because if ptiCurrent is the thread that created</span></div>
<div class="line"><a name="l03671"></a><span class="lineno"> 3671</span>&#160;<span class="comment">                 * the main desktop, it&#39;s associated desktop is the logon</span></div>
<div class="line"><a name="l03672"></a><span class="lineno"> 3672</span>&#160;<span class="comment">                 * desktop - don&#39;t want to hittest against the logon desktop</span></div>
<div class="line"><a name="l03673"></a><span class="lineno"> 3673</span>&#160;<span class="comment">                 * while switched into the main desktop!</span></div>
<div class="line"><a name="l03674"></a><span class="lineno"> 3674</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03675"></a><span class="lineno"> 3675</span>&#160;                pwndT = <a class="code" href="a03257.html#a15b01bf3bf02ba131160e26e97f4abf5">gptiRit</a>-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>;</div>
<div class="line"><a name="l03676"></a><span class="lineno"> 3676</span>&#160;                ThreadLockWithPti(ptiCurrent, pwndT, &amp;tlpwndT);</div>
<div class="line"><a name="l03677"></a><span class="lineno"> 3677</span>&#160;                hwnd = <a class="code" href="a00899.html#ac7b632aec491adfba0ade3cd2eb6dca4">xxxWindowHitTest</a>(pwndT, pt, &amp;part, TRUE);</div>
<div class="line"><a name="l03678"></a><span class="lineno"> 3678</span>&#160;                ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l03679"></a><span class="lineno"> 3679</span>&#160; </div>
<div class="line"><a name="l03680"></a><span class="lineno"> 3680</span>&#160;                <span class="keywordflow">if</span> ((pwnd = RevalidateHwnd(hwnd)) == NULL) {</div>
<div class="line"><a name="l03681"></a><span class="lineno"> 3681</span>&#160;                    pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>;</div>
<div class="line"><a name="l03682"></a><span class="lineno"> 3682</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x200000);</div>
<div class="line"><a name="l03683"></a><span class="lineno"> 3683</span>&#160;                }</div>
<div class="line"><a name="l03684"></a><span class="lineno"> 3684</span>&#160; </div>
<div class="line"><a name="l03685"></a><span class="lineno"> 3685</span>&#160;                <span class="keywordflow">if</span> (part == HTCLIENT) {</div>
<div class="line"><a name="l03686"></a><span class="lineno"> 3686</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03687"></a><span class="lineno"> 3687</span>&#160;<span class="comment">                     * Part of the client... normal mouse message.</span></div>
<div class="line"><a name="l03688"></a><span class="lineno"> 3688</span>&#160;<span class="comment">                     * NO_CAP_CLIENT means &quot;not captured, in client area</span></div>
<div class="line"><a name="l03689"></a><span class="lineno"> 3689</span>&#160;<span class="comment">                     * of window&quot;.</span></div>
<div class="line"><a name="l03690"></a><span class="lineno"> 3690</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03691"></a><span class="lineno"> 3691</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> = NO_CAP_CLIENT;</div>
<div class="line"><a name="l03692"></a><span class="lineno"> 3692</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x400000);</div>
<div class="line"><a name="l03693"></a><span class="lineno"> 3693</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03694"></a><span class="lineno"> 3694</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03695"></a><span class="lineno"> 3695</span>&#160;<span class="comment">                     * Not part of the client... must be an NCMOUSEMESSAGE.</span></div>
<div class="line"><a name="l03696"></a><span class="lineno"> 3696</span>&#160;<span class="comment">                     * NO_CAP_SYS is a creative name by raor which means</span></div>
<div class="line"><a name="l03697"></a><span class="lineno"> 3697</span>&#160;<span class="comment">                     * &quot;not captured, in system area of window.&quot;</span></div>
<div class="line"><a name="l03698"></a><span class="lineno"> 3698</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03699"></a><span class="lineno"> 3699</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> = NO_CAP_SYS;</div>
<div class="line"><a name="l03700"></a><span class="lineno"> 3700</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x800000);</div>
<div class="line"><a name="l03701"></a><span class="lineno"> 3701</span>&#160;                }</div>
<div class="line"><a name="l03702"></a><span class="lineno"> 3702</span>&#160;            }</div>
<div class="line"><a name="l03703"></a><span class="lineno"> 3703</span>&#160; </div>
<div class="line"><a name="l03704"></a><span class="lineno"> 3704</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03705"></a><span class="lineno"> 3705</span>&#160;<span class="comment">             * We&#39;ve reassigned pwnd, so lock it.</span></div>
<div class="line"><a name="l03706"></a><span class="lineno"> 3706</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03707"></a><span class="lineno"> 3707</span>&#160;            ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l03708"></a><span class="lineno"> 3708</span>&#160;            ThreadLockWithPti(ptiCurrent, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l03709"></a><span class="lineno"> 3709</span>&#160; </div>
<div class="line"><a name="l03710"></a><span class="lineno"> 3710</span>&#160;            <span class="keywordflow">if</span> (fOtherApp = (GETPTI(pwnd) != ptiCurrent)) {</div>
<div class="line"><a name="l03711"></a><span class="lineno"> 3711</span>&#160; </div>
<div class="line"><a name="l03712"></a><span class="lineno"> 3712</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x1000000);</div>
<div class="line"><a name="l03713"></a><span class="lineno"> 3713</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03714"></a><span class="lineno"> 3714</span>&#160;<span class="comment">                 * If this other app isn&#39;t going to read from this</span></div>
<div class="line"><a name="l03715"></a><span class="lineno"> 3715</span>&#160;<span class="comment">                 * queue, then skip this message. This can happen if</span></div>
<div class="line"><a name="l03716"></a><span class="lineno"> 3716</span>&#160;<span class="comment">                 * the RIT queues up a message thinking it goes to</span></div>
<div class="line"><a name="l03717"></a><span class="lineno"> 3717</span>&#160;<span class="comment">                 * a particular hwnd, but then by the time GetMessage()</span></div>
<div class="line"><a name="l03718"></a><span class="lineno"> 3718</span>&#160;<span class="comment">                 * is called for that thread, it doesn&#39;t go to that hwnd</span></div>
<div class="line"><a name="l03719"></a><span class="lineno"> 3719</span>&#160;<span class="comment">                 * (like in the case of mouse messages, window rearrangement</span></div>
<div class="line"><a name="l03720"></a><span class="lineno"> 3720</span>&#160;<span class="comment">                 * happens which changes which hwnd the mouse hits on).</span></div>
<div class="line"><a name="l03721"></a><span class="lineno"> 3721</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03722"></a><span class="lineno"> 3722</span>&#160;                <span class="keywordflow">if</span> (GETPTI(pwnd)-&gt;pq != ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) {</div>
<div class="line"><a name="l03723"></a><span class="lineno"> 3723</span>&#160;                    <a class="code" href="a00638.html#a326162b93195122192df202ff2db430a">_SetCursor</a>(SYSCUR(ARROW));</div>
<div class="line"><a name="l03724"></a><span class="lineno"> 3724</span>&#160;                    <a class="code" href="a03290.html#ab7a8ea0145ef1df8bfb450d1ac6fed9e">ResetMouseTracking</a>(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, NULL);</div>
<div class="line"><a name="l03725"></a><span class="lineno"> 3725</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x2000000);</div>
<div class="line"><a name="l03726"></a><span class="lineno"> 3726</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l03727"></a><span class="lineno"> 3727</span>&#160;                }</div>
<div class="line"><a name="l03728"></a><span class="lineno"> 3728</span>&#160; </div>
<div class="line"><a name="l03729"></a><span class="lineno"> 3729</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03730"></a><span class="lineno"> 3730</span>&#160;<span class="comment">                 * If we haven&#39;t already found a message that is intended</span></div>
<div class="line"><a name="l03731"></a><span class="lineno"> 3731</span>&#160;<span class="comment">                 * for another app, remember that we have one.</span></div>
<div class="line"><a name="l03732"></a><span class="lineno"> 3732</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03733"></a><span class="lineno"> 3733</span>&#160;                <span class="keywordflow">if</span> (ptiMouseWake == NULL) {</div>
<div class="line"><a name="l03734"></a><span class="lineno"> 3734</span>&#160;                    ptiMouseWake = GETPTI(pwnd);</div>
<div class="line"><a name="l03735"></a><span class="lineno"> 3735</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x4000000);</div>
<div class="line"><a name="l03736"></a><span class="lineno"> 3736</span>&#160;                }</div>
<div class="line"><a name="l03737"></a><span class="lineno"> 3737</span>&#160;            }</div>
<div class="line"><a name="l03738"></a><span class="lineno"> 3738</span>&#160; </div>
<div class="line"><a name="l03739"></a><span class="lineno"> 3739</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03740"></a><span class="lineno"> 3740</span>&#160;<span class="comment">             * Map mouse coordinates based on hit test area code.</span></div>
<div class="line"><a name="l03741"></a><span class="lineno"> 3741</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03742"></a><span class="lineno"> 3742</span>&#160;            <span class="keywordflow">switch</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a>) {</div>
<div class="line"><a name="l03743"></a><span class="lineno"> 3743</span>&#160;            <span class="keywordflow">case</span> CLIENT_CAPTURE:</div>
<div class="line"><a name="l03744"></a><span class="lineno"> 3744</span>&#160;            <span class="keywordflow">case</span> NO_CAP_CLIENT:</div>
<div class="line"><a name="l03745"></a><span class="lineno"> 3745</span>&#160;                pt.x -= pwnd-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.left;</div>
<div class="line"><a name="l03746"></a><span class="lineno"> 3746</span>&#160;                pt.y -= pwnd-&gt;<a class="code" href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">rcClient</a>.top;</div>
<div class="line"><a name="l03747"></a><span class="lineno"> 3747</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(2);</div>
<div class="line"><a name="l03748"></a><span class="lineno"> 3748</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03749"></a><span class="lineno"> 3749</span>&#160; </div>
<div class="line"><a name="l03750"></a><span class="lineno"> 3750</span>&#160;            <span class="keywordflow">case</span> WINDOW_CAPTURE:</div>
<div class="line"><a name="l03751"></a><span class="lineno"> 3751</span>&#160;                pt.x -= pwnd-&gt;<a class="code" href="a02581.html#a2778d611c2b27395e559c94d05732e1f">rcWindow</a>.left;</div>
<div class="line"><a name="l03752"></a><span class="lineno"> 3752</span>&#160;                pt.y -= pwnd-&gt;<a class="code" href="a02581.html#a2778d611c2b27395e559c94d05732e1f">rcWindow</a>.top;</div>
<div class="line"><a name="l03753"></a><span class="lineno"> 3753</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(4);</div>
<div class="line"><a name="l03754"></a><span class="lineno"> 3754</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03755"></a><span class="lineno"> 3755</span>&#160;            }</div>
<div class="line"><a name="l03756"></a><span class="lineno"> 3756</span>&#160; </div>
<div class="line"><a name="l03757"></a><span class="lineno"> 3757</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03758"></a><span class="lineno"> 3758</span>&#160;<span class="comment">             * Do mouse hover processing.</span></div>
<div class="line"><a name="l03759"></a><span class="lineno"> 3759</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03760"></a><span class="lineno"> 3760</span>&#160;            pwndMouse = (part == HTCLIENT) ? pwnd : NULL;</div>
<div class="line"><a name="l03761"></a><span class="lineno"> 3761</span>&#160;            <span class="keywordflow">if</span> (pwndMouse != ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>) {</div>
<div class="line"><a name="l03762"></a><span class="lineno"> 3762</span>&#160;                <a class="code" href="a03290.html#a98458d5f8be030de82ee292c023bb341">MouseEnter</a>(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, pwndMouse);</div>
<div class="line"><a name="l03763"></a><span class="lineno"> 3763</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_TRACKMOUSEHOVER) {</div>
<div class="line"><a name="l03764"></a><span class="lineno"> 3764</span>&#160;                <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l03765"></a><span class="lineno"> 3765</span>&#160;                <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l03766"></a><span class="lineno"> 3766</span>&#160;                    <span class="keywordflow">if</span> (<a class="code" href="a00935.html#a75b3bf802c369845c4381fcee638bc8a">PtInRect</a>(&amp;ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a72a2774228eff8f8a0c25ef4da8c8fee">rcMouseHover</a>, pt))</div>
<div class="line"><a name="l03767"></a><span class="lineno"> 3767</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03768"></a><span class="lineno"> 3768</span>&#160;                    <span class="comment">// FALL THROUGH</span></div>
<div class="line"><a name="l03769"></a><span class="lineno"> 3769</span>&#160; </div>
<div class="line"><a name="l03770"></a><span class="lineno"> 3770</span>&#160;                <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l03771"></a><span class="lineno"> 3771</span>&#160;                <span class="keywordflow">case</span> WM_LBUTTONUP:</div>
<div class="line"><a name="l03772"></a><span class="lineno"> 3772</span>&#160;                <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l03773"></a><span class="lineno"> 3773</span>&#160;                <span class="keywordflow">case</span> WM_RBUTTONUP:</div>
<div class="line"><a name="l03774"></a><span class="lineno"> 3774</span>&#160;                <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l03775"></a><span class="lineno"> 3775</span>&#160;                <span class="keywordflow">case</span> WM_MBUTTONUP:</div>
<div class="line"><a name="l03776"></a><span class="lineno"> 3776</span>&#160;                    <a class="code" href="a03290.html#ae115b86b442f263c94c5219ccc4240cd">ResetMouseHover</a>(pt);</div>
<div class="line"><a name="l03777"></a><span class="lineno"> 3777</span>&#160;                }</div>
<div class="line"><a name="l03778"></a><span class="lineno"> 3778</span>&#160;            }</div>
<div class="line"><a name="l03779"></a><span class="lineno"> 3779</span>&#160; </div>
<div class="line"><a name="l03780"></a><span class="lineno"> 3780</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03781"></a><span class="lineno"> 3781</span>&#160;<span class="comment">             * Now see if it matches the window handle filter. If not,</span></div>
<div class="line"><a name="l03782"></a><span class="lineno"> 3782</span>&#160;<span class="comment">             * get the next message.</span></div>
<div class="line"><a name="l03783"></a><span class="lineno"> 3783</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03784"></a><span class="lineno"> 3784</span>&#160;            <span class="keywordflow">if</span> (!<a class="code" href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a>(pwnd, pwndFilter)) {</div>
<div class="line"><a name="l03785"></a><span class="lineno"> 3785</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x8000000);</div>
<div class="line"><a name="l03786"></a><span class="lineno"> 3786</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03787"></a><span class="lineno"> 3787</span>&#160;            }</div>
<div class="line"><a name="l03788"></a><span class="lineno"> 3788</span>&#160; </div>
<div class="line"><a name="l03789"></a><span class="lineno"> 3789</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03790"></a><span class="lineno"> 3790</span>&#160;<span class="comment">             * See if we need to map to a double click.</span></div>
<div class="line"><a name="l03791"></a><span class="lineno"> 3791</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03792"></a><span class="lineno"> 3792</span>&#160;            codeMouseDown = 0;</div>
<div class="line"><a name="l03793"></a><span class="lineno"> 3793</span>&#160;            <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l03794"></a><span class="lineno"> 3794</span>&#160;            <span class="keywordflow">case</span> WM_LBUTTONDOWN:</div>
<div class="line"><a name="l03795"></a><span class="lineno"> 3795</span>&#160;            <span class="keywordflow">case</span> WM_RBUTTONDOWN:</div>
<div class="line"><a name="l03796"></a><span class="lineno"> 3796</span>&#160;            <span class="keywordflow">case</span> WM_MBUTTONDOWN:</div>
<div class="line"><a name="l03797"></a><span class="lineno"> 3797</span>&#160;                <span class="keywordflow">if</span> (TestCF(pwnd, CFDBLCLKS) ||</div>
<div class="line"><a name="l03798"></a><span class="lineno"> 3798</span>&#160;                        ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> == NO_CAP_SYS ||</div>
<div class="line"><a name="l03799"></a><span class="lineno"> 3799</span>&#160;                        <a class="code" href="a00899.html#af1b5f58e67f1282eed05c0c519866f7c">IsMenuStarted</a>(ptiCurrent)) {</div>
<div class="line"><a name="l03800"></a><span class="lineno"> 3800</span>&#160;                    codeMouseDown++;</div>
<div class="line"><a name="l03801"></a><span class="lineno"> 3801</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x10000000);</div>
<div class="line"><a name="l03802"></a><span class="lineno"> 3802</span>&#160;                    <span class="keywordflow">if</span> (qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time &lt;= ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0ad3f886c56de3c6a971662e15ee861">timeDblClk</a> &amp;&amp;</div>
<div class="line"><a name="l03803"></a><span class="lineno"> 3803</span>&#160;                            pwnd == PW(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a34db7603fdeb49fef752d4362124d5c2">hwndDblClk</a>) &amp;&amp;</div>
<div class="line"><a name="l03804"></a><span class="lineno"> 3804</span>&#160;                            <a class="code" href="a00935.html#a75b3bf802c369845c4381fcee638bc8a">PtInRect</a>(&amp;ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a47cf05ff40a81ae529300bef68e731d5">rcDblClk</a>, qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt) &amp;&amp;</div>
<div class="line"><a name="l03805"></a><span class="lineno"> 3805</span>&#160;                            message == ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ac8463e1b385969090970958b7a1a7c98">msgDblClk</a>) {</div>
<div class="line"><a name="l03806"></a><span class="lineno"> 3806</span>&#160;                        message += (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN);</div>
<div class="line"><a name="l03807"></a><span class="lineno"> 3807</span>&#160;                        codeMouseDown++;</div>
<div class="line"><a name="l03808"></a><span class="lineno"> 3808</span>&#160;                        <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x20000000);</div>
<div class="line"><a name="l03809"></a><span class="lineno"> 3809</span>&#160;                    }</div>
<div class="line"><a name="l03810"></a><span class="lineno"> 3810</span>&#160;                }</div>
<div class="line"><a name="l03811"></a><span class="lineno"> 3811</span>&#160; </div>
<div class="line"><a name="l03812"></a><span class="lineno"> 3812</span>&#160;            <span class="comment">// FALL THROUGH!!!</span></div>
<div class="line"><a name="l03813"></a><span class="lineno"> 3813</span>&#160; </div>
<div class="line"><a name="l03814"></a><span class="lineno"> 3814</span>&#160;            <span class="keywordflow">case</span> WM_LBUTTONUP:</div>
<div class="line"><a name="l03815"></a><span class="lineno"> 3815</span>&#160;            <span class="keywordflow">case</span> WM_RBUTTONUP:</div>
<div class="line"><a name="l03816"></a><span class="lineno"> 3816</span>&#160;            <span class="keywordflow">case</span> WM_MBUTTONUP:</div>
<div class="line"><a name="l03817"></a><span class="lineno"> 3817</span>&#160; </div>
<div class="line"><a name="l03818"></a><span class="lineno"> 3818</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03819"></a><span class="lineno"> 3819</span>&#160;<span class="comment">                 * Note that the mouse button went up or down if we were</span></div>
<div class="line"><a name="l03820"></a><span class="lineno"> 3820</span>&#160;<span class="comment">                 * in menu status mode of alt-key down</span></div>
<div class="line"><a name="l03821"></a><span class="lineno"> 3821</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03822"></a><span class="lineno"> 3822</span>&#160; </div>
<div class="line"><a name="l03823"></a><span class="lineno"> 3823</span>&#160;                <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x40000000);</div>
<div class="line"><a name="l03824"></a><span class="lineno"> 3824</span>&#160;                <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_FMENUSTATUS) {</div>
<div class="line"><a name="l03825"></a><span class="lineno"> 3825</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_FMENUSTATUSBREAK;</div>
<div class="line"><a name="l03826"></a><span class="lineno"> 3826</span>&#160;                    <a class="code" href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a>(0x80000000);</div>
<div class="line"><a name="l03827"></a><span class="lineno"> 3827</span>&#160;                }</div>
<div class="line"><a name="l03828"></a><span class="lineno"> 3828</span>&#160;            }</div>
<div class="line"><a name="l03829"></a><span class="lineno"> 3829</span>&#160; </div>
<div class="line"><a name="l03830"></a><span class="lineno"> 3830</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03831"></a><span class="lineno"> 3831</span>&#160;<span class="comment">             * Map message number based on hit test area code.</span></div>
<div class="line"><a name="l03832"></a><span class="lineno"> 3832</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03833"></a><span class="lineno"> 3833</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> == NO_CAP_SYS) {</div>
<div class="line"><a name="l03834"></a><span class="lineno"> 3834</span>&#160;                message += (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)(WM_NCMOUSEMOVE - WM_MOUSEMOVE);</div>
<div class="line"><a name="l03835"></a><span class="lineno"> 3835</span>&#160;                wParam = (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)part;</div>
<div class="line"><a name="l03836"></a><span class="lineno"> 3836</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(1);</div>
<div class="line"><a name="l03837"></a><span class="lineno"> 3837</span>&#160;            }</div>
<div class="line"><a name="l03838"></a><span class="lineno"> 3838</span>&#160; </div>
<div class="line"><a name="l03839"></a><span class="lineno"> 3839</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03840"></a><span class="lineno"> 3840</span>&#160;<span class="comment">             * Message number has been mapped: see if it fits the filter.</span></div>
<div class="line"><a name="l03841"></a><span class="lineno"> 3841</span>&#160;<span class="comment">             * If not, get the next message.</span></div>
<div class="line"><a name="l03842"></a><span class="lineno"> 3842</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03843"></a><span class="lineno"> 3843</span>&#160;            <span class="keywordflow">if</span> (!CheckMsgFilter(message, msgMinFilter, msgMaxFilter)) {</div>
<div class="line"><a name="l03844"></a><span class="lineno"> 3844</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(8);</div>
<div class="line"><a name="l03845"></a><span class="lineno"> 3845</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03846"></a><span class="lineno"> 3846</span>&#160;            }</div>
<div class="line"><a name="l03847"></a><span class="lineno"> 3847</span>&#160; </div>
<div class="line"><a name="l03848"></a><span class="lineno"> 3848</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03849"></a><span class="lineno"> 3849</span>&#160;<span class="comment">             * If message is for another app but it fits our filter, then</span></div>
<div class="line"><a name="l03850"></a><span class="lineno"> 3850</span>&#160;<span class="comment">             * we should stop looking for messages: this will ensure that</span></div>
<div class="line"><a name="l03851"></a><span class="lineno"> 3851</span>&#160;<span class="comment">             * we don&#39;t keep looking and find and process a message that</span></div>
<div class="line"><a name="l03852"></a><span class="lineno"> 3852</span>&#160;<span class="comment">             * occured later than the one that should be processed by the</span></div>
<div class="line"><a name="l03853"></a><span class="lineno"> 3853</span>&#160;<span class="comment">             * other guy.</span></div>
<div class="line"><a name="l03854"></a><span class="lineno"> 3854</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03855"></a><span class="lineno"> 3855</span>&#160;            <span class="keywordflow">if</span> (fOtherApp) {</div>
<div class="line"><a name="l03856"></a><span class="lineno"> 3856</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x10);</div>
<div class="line"><a name="l03857"></a><span class="lineno"> 3857</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l03858"></a><span class="lineno"> 3858</span>&#160;            }</div>
<div class="line"><a name="l03859"></a><span class="lineno"> 3859</span>&#160; </div>
<div class="line"><a name="l03860"></a><span class="lineno"> 3860</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03861"></a><span class="lineno"> 3861</span>&#160;<span class="comment">             * If we&#39;re doing full drag, the mouse messages should go to</span></div>
<div class="line"><a name="l03862"></a><span class="lineno"> 3862</span>&#160;<span class="comment">             * the xxxMoveSize PeekMessage loop. So we get the next message.</span></div>
<div class="line"><a name="l03863"></a><span class="lineno"> 3863</span>&#160;<span class="comment">             * This can happen when an application does a PeekMessage in</span></div>
<div class="line"><a name="l03864"></a><span class="lineno"> 3864</span>&#160;<span class="comment">             * response to a message sent inside the movesize dragging loop.</span></div>
<div class="line"><a name="l03865"></a><span class="lineno"> 3865</span>&#160;<span class="comment">             * This causes the dragging loop to not get the WM_LBUTTONUP</span></div>
<div class="line"><a name="l03866"></a><span class="lineno"> 3866</span>&#160;<span class="comment">             * message and dragging continues after the button is up</span></div>
<div class="line"><a name="l03867"></a><span class="lineno"> 3867</span>&#160;<span class="comment">             * (fix for Micrografx Draw). -johannec</span></div>
<div class="line"><a name="l03868"></a><span class="lineno"> 3868</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03869"></a><span class="lineno"> 3869</span>&#160;            <span class="keywordflow">if</span> (message &gt;= WM_MOUSEFIRST &amp;&amp; message &lt;= WM_MOUSELAST &amp;&amp;</div>
<div class="line"><a name="l03870"></a><span class="lineno"> 3870</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_MOVESIZETRACKING) {</div>
<div class="line"><a name="l03871"></a><span class="lineno"> 3871</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x20);</div>
<div class="line"><a name="l03872"></a><span class="lineno"> 3872</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03873"></a><span class="lineno"> 3873</span>&#160;            }</div>
<div class="line"><a name="l03874"></a><span class="lineno"> 3874</span>&#160; </div>
<div class="line"><a name="l03875"></a><span class="lineno"> 3875</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03876"></a><span class="lineno"> 3876</span>&#160;<span class="comment">             * Let us call the mouse hook to find out if this click is</span></div>
<div class="line"><a name="l03877"></a><span class="lineno"> 3877</span>&#160;<span class="comment">             * permitted by it.</span></div>
<div class="line"><a name="l03878"></a><span class="lineno"> 3878</span>&#160;<span class="comment">             *</span></div>
<div class="line"><a name="l03879"></a><span class="lineno"> 3879</span>&#160;<span class="comment">             * We want to inform the mouse hook before we test for</span></div>
<div class="line"><a name="l03880"></a><span class="lineno"> 3880</span>&#160;<span class="comment">             * HTNOWHERE and HTERROR; Otherwise, the mouse hook won&#39;t</span></div>
<div class="line"><a name="l03881"></a><span class="lineno"> 3881</span>&#160;<span class="comment">             * get these messages (sankar 12/10/91).</span></div>
<div class="line"><a name="l03882"></a><span class="lineno"> 3882</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03883"></a><span class="lineno"> 3883</span>&#160;            <span class="keywordflow">if</span> (IsHooked(ptiCurrent, WHF_MOUSE)) {</div>
<div class="line"><a name="l03884"></a><span class="lineno"> 3884</span>&#160;                fMouseHookCalled = TRUE;</div>
<div class="line"><a name="l03885"></a><span class="lineno"> 3885</span>&#160;                mhs.pt = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt;</div>
<div class="line"><a name="l03886"></a><span class="lineno"> 3886</span>&#160;                mhs.hwnd = HW(pwnd);</div>
<div class="line"><a name="l03887"></a><span class="lineno"> 3887</span>&#160;                mhs.wHitTestCode = (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)part;</div>
<div class="line"><a name="l03888"></a><span class="lineno"> 3888</span>&#160;                mhs.dwExtraInfo = qmsg.<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>;</div>
<div class="line"><a name="l03889"></a><span class="lineno"> 3889</span>&#160; </div>
<div class="line"><a name="l03890"></a><span class="lineno"> 3890</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="a00701.html#a3f27401daee77aa63faa3ff562de7207">xxxCallMouseHook</a>(message, &amp;mhs, fRemove)) {</div>
<div class="line"><a name="l03891"></a><span class="lineno"> 3891</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03892"></a><span class="lineno"> 3892</span>&#160;<span class="comment">                     * Not allowed by mouse hook; so skip it.</span></div>
<div class="line"><a name="l03893"></a><span class="lineno"> 3893</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03894"></a><span class="lineno"> 3894</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x40);</div>
<div class="line"><a name="l03895"></a><span class="lineno"> 3895</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l03896"></a><span class="lineno"> 3896</span>&#160;                }</div>
<div class="line"><a name="l03897"></a><span class="lineno"> 3897</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x80);</div>
<div class="line"><a name="l03898"></a><span class="lineno"> 3898</span>&#160;            }</div>
<div class="line"><a name="l03899"></a><span class="lineno"> 3899</span>&#160; </div>
<div class="line"><a name="l03900"></a><span class="lineno"> 3900</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03901"></a><span class="lineno"> 3901</span>&#160;<span class="comment">             * If a HTERROR or HTNOWHERE occured, send the window the</span></div>
<div class="line"><a name="l03902"></a><span class="lineno"> 3902</span>&#160;<span class="comment">             * WM_SETCURSOR message so it can beep or whatever. Then skip</span></div>
<div class="line"><a name="l03903"></a><span class="lineno"> 3903</span>&#160;<span class="comment">             * the message and try the next one.</span></div>
<div class="line"><a name="l03904"></a><span class="lineno"> 3904</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03905"></a><span class="lineno"> 3905</span>&#160;            <span class="keywordflow">switch</span> (part) {</div>
<div class="line"><a name="l03906"></a><span class="lineno"> 3906</span>&#160;            <span class="keywordflow">case</span> HTERROR:</div>
<div class="line"><a name="l03907"></a><span class="lineno"> 3907</span>&#160;            <span class="keywordflow">case</span> HTNOWHERE:</div>
<div class="line"><a name="l03908"></a><span class="lineno"> 3908</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03909"></a><span class="lineno"> 3909</span>&#160;<span class="comment">                 * Now set the cursor shape.</span></div>
<div class="line"><a name="l03910"></a><span class="lineno"> 3910</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03911"></a><span class="lineno"> 3911</span>&#160;                <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwnd, WM_SETCURSOR, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)HW(pwnd),</div>
<div class="line"><a name="l03912"></a><span class="lineno"> 3912</span>&#160;                        MAKELONG(part, qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message));</div>
<div class="line"><a name="l03913"></a><span class="lineno"> 3913</span>&#160; </div>
<div class="line"><a name="l03914"></a><span class="lineno"> 3914</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03915"></a><span class="lineno"> 3915</span>&#160;<span class="comment">                 * Skip the message.</span></div>
<div class="line"><a name="l03916"></a><span class="lineno"> 3916</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03917"></a><span class="lineno"> 3917</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x100);</div>
<div class="line"><a name="l03918"></a><span class="lineno"> 3918</span>&#160;                <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l03919"></a><span class="lineno"> 3919</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03920"></a><span class="lineno"> 3920</span>&#160;            }</div>
<div class="line"><a name="l03921"></a><span class="lineno"> 3921</span>&#160; </div>
<div class="line"><a name="l03922"></a><span class="lineno"> 3922</span>&#160;            <span class="keywordflow">if</span> (fRemove) {</div>
<div class="line"><a name="l03923"></a><span class="lineno"> 3923</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x200);</div>
<div class="line"><a name="l03924"></a><span class="lineno"> 3924</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03925"></a><span class="lineno"> 3925</span>&#160;<span class="comment">                 * Since the processing of a down click may cause the next</span></div>
<div class="line"><a name="l03926"></a><span class="lineno"> 3926</span>&#160;<span class="comment">                 * message to be interpreted as a double click, we only want</span></div>
<div class="line"><a name="l03927"></a><span class="lineno"> 3927</span>&#160;<span class="comment">                 * to do the double click setup if we&#39;re actually going to</span></div>
<div class="line"><a name="l03928"></a><span class="lineno"> 3928</span>&#160;<span class="comment">                 * remove the message.  Otherwise, the next time we read the</span></div>
<div class="line"><a name="l03929"></a><span class="lineno"> 3929</span>&#160;<span class="comment">                 * same message it would be interpreted as a double click.</span></div>
<div class="line"><a name="l03930"></a><span class="lineno"> 3930</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03931"></a><span class="lineno"> 3931</span>&#160;                <span class="keywordflow">switch</span> (codeMouseDown) {</div>
<div class="line"><a name="l03932"></a><span class="lineno"> 3932</span>&#160;                <span class="keywordflow">case</span> 1:</div>
<div class="line"><a name="l03933"></a><span class="lineno"> 3933</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03934"></a><span class="lineno"> 3934</span>&#160;<span class="comment">                     * Down clock: set up for later possible double click.</span></div>
<div class="line"><a name="l03935"></a><span class="lineno"> 3935</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03936"></a><span class="lineno"> 3936</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ac8463e1b385969090970958b7a1a7c98">msgDblClk</a> = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message;</div>
<div class="line"><a name="l03937"></a><span class="lineno"> 3937</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0ad3f886c56de3c6a971662e15ee861">timeDblClk</a> = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time + <a class="code" href="a03257.html#ad846449b20bf30ca2a61fb9a236cbfd1">dtDblClk</a>;</div>
<div class="line"><a name="l03938"></a><span class="lineno"> 3938</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a34db7603fdeb49fef752d4362124d5c2">hwndDblClk</a> = HW(pwnd);</div>
<div class="line"><a name="l03939"></a><span class="lineno"> 3939</span>&#160;                    <a class="code" href="a00935.html#a479bbe69c871894f6ca23dfa237481ad">SetRect</a>(&amp;ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a47cf05ff40a81ae529300bef68e731d5">rcDblClk</a>,</div>
<div class="line"><a name="l03940"></a><span class="lineno"> 3940</span>&#160;                            qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt.x - SYSMET(CXDOUBLECLK) / 2,</div>
<div class="line"><a name="l03941"></a><span class="lineno"> 3941</span>&#160;                            qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt.y - SYSMET(CYDOUBLECLK) / 2,</div>
<div class="line"><a name="l03942"></a><span class="lineno"> 3942</span>&#160;                            qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt.x + SYSMET(CXDOUBLECLK) / 2,</div>
<div class="line"><a name="l03943"></a><span class="lineno"> 3943</span>&#160;                            qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt.y + SYSMET(CYDOUBLECLK) / 2);</div>
<div class="line"><a name="l03944"></a><span class="lineno"> 3944</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x400);</div>
<div class="line"><a name="l03945"></a><span class="lineno"> 3945</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>&#160; </div>
<div class="line"><a name="l03947"></a><span class="lineno"> 3947</span>&#160;                <span class="keywordflow">case</span> 2:</div>
<div class="line"><a name="l03948"></a><span class="lineno"> 3948</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03949"></a><span class="lineno"> 3949</span>&#160;<span class="comment">                     * Double click: finish processing.</span></div>
<div class="line"><a name="l03950"></a><span class="lineno"> 3950</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03951"></a><span class="lineno"> 3951</span>&#160;                    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0ad3f886c56de3c6a971662e15ee861">timeDblClk</a> = 0L;</div>
<div class="line"><a name="l03952"></a><span class="lineno"> 3952</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x800);</div>
<div class="line"><a name="l03953"></a><span class="lineno"> 3953</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03954"></a><span class="lineno"> 3954</span>&#160; </div>
<div class="line"><a name="l03955"></a><span class="lineno"> 3955</span>&#160;                <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l03956"></a><span class="lineno"> 3956</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x1000);</div>
<div class="line"><a name="l03957"></a><span class="lineno"> 3957</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03958"></a><span class="lineno"> 3958</span>&#160;                }</div>
<div class="line"><a name="l03959"></a><span class="lineno"> 3959</span>&#160; </div>
<div class="line"><a name="l03960"></a><span class="lineno"> 3960</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03961"></a><span class="lineno"> 3961</span>&#160;<span class="comment">                 * Set mouse cursor and allow app to activate window</span></div>
<div class="line"><a name="l03962"></a><span class="lineno"> 3962</span>&#160;<span class="comment">                 * only if we&#39;re removing the message.</span></div>
<div class="line"><a name="l03963"></a><span class="lineno"> 3963</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03964"></a><span class="lineno"> 3964</span>&#160;                <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a8e55eab39af5bc9e6f4bf22b243cda82">xxxMouseActivate</a>(ptiCurrent, pwnd,</div>
<div class="line"><a name="l03965"></a><span class="lineno"> 3965</span>&#160;                        qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message, &amp;qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt, part)) {</div>
<div class="line"><a name="l03966"></a><span class="lineno"> 3966</span>&#160;SkipMessage:</div>
<div class="line"><a name="l03967"></a><span class="lineno"> 3967</span>&#160;                <span class="keywordflow">case</span> <a class="code" href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a>:</div>
<div class="line"><a name="l03968"></a><span class="lineno"> 3968</span>&#160;                    <a class="code" href="a03290.html#a4a3403c63c49e44a7fa551d0d6f475b0">DUMPSUBPATHTAKEN</a>(pathTaken2, 0x2000);</div>
<div class="line"><a name="l03969"></a><span class="lineno"> 3969</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x2000);</div>
<div class="line"><a name="l03970"></a><span class="lineno"> 3970</span>&#160;                    <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l03971"></a><span class="lineno"> 3971</span>&#160; </div>
<div class="line"><a name="l03972"></a><span class="lineno"> 3972</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03973"></a><span class="lineno"> 3973</span>&#160;<span class="comment">                     * Inform the CBT hook that we skipped a mouse click.</span></div>
<div class="line"><a name="l03974"></a><span class="lineno"> 3974</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03975"></a><span class="lineno"> 3975</span>&#160;                    <span class="keywordflow">if</span> (fMouseHookCalled) {</div>
<div class="line"><a name="l03976"></a><span class="lineno"> 3976</span>&#160;                        <span class="keywordflow">if</span> (IsHooked(ptiCurrent, WHF_CBT)) {</div>
<div class="line"><a name="l03977"></a><span class="lineno"> 3977</span>&#160;                            <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HCBT_CLICKSKIPPED, message,</div>
<div class="line"><a name="l03978"></a><span class="lineno"> 3978</span>&#160;                                    (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)&amp;mhs, WH_CBT);</div>
<div class="line"><a name="l03979"></a><span class="lineno"> 3979</span>&#160;                            <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x4000);</div>
<div class="line"><a name="l03980"></a><span class="lineno"> 3980</span>&#160;                        }</div>
<div class="line"><a name="l03981"></a><span class="lineno"> 3981</span>&#160;                        fMouseHookCalled = FALSE;</div>
<div class="line"><a name="l03982"></a><span class="lineno"> 3982</span>&#160;                    }</div>
<div class="line"><a name="l03983"></a><span class="lineno"> 3983</span>&#160; </div>
<div class="line"><a name="l03984"></a><span class="lineno"> 3984</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03985"></a><span class="lineno"> 3985</span>&#160;<span class="comment">                     * Inform the CBT hook that we skipped a key</span></div>
<div class="line"><a name="l03986"></a><span class="lineno"> 3986</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l03987"></a><span class="lineno"> 3987</span>&#160;                    <span class="keywordflow">if</span> (fKbdHookCalled) {</div>
<div class="line"><a name="l03988"></a><span class="lineno"> 3988</span>&#160;                        <span class="keywordflow">if</span> (IsHooked(ptiCurrent, WHF_CBT)) {</div>
<div class="line"><a name="l03989"></a><span class="lineno"> 3989</span>&#160;                            <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HCBT_KEYSKIPPED, wParam, lParam,</div>
<div class="line"><a name="l03990"></a><span class="lineno"> 3990</span>&#160;                                    WH_CBT);</div>
<div class="line"><a name="l03991"></a><span class="lineno"> 3991</span>&#160;                            <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x8000);</div>
<div class="line"><a name="l03992"></a><span class="lineno"> 3992</span>&#160;                        }</div>
<div class="line"><a name="l03993"></a><span class="lineno"> 3993</span>&#160;                        fKbdHookCalled = FALSE;</div>
<div class="line"><a name="l03994"></a><span class="lineno"> 3994</span>&#160;                    }</div>
<div class="line"><a name="l03995"></a><span class="lineno"> 3995</span>&#160; </div>
<div class="line"><a name="l03996"></a><span class="lineno"> 3996</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l03997"></a><span class="lineno"> 3997</span>&#160;<span class="comment">                     * If we aren&#39;t removing messages, don&#39;t reset idSysPeek</span></div>
<div class="line"><a name="l03998"></a><span class="lineno"> 3998</span>&#160;<span class="comment">                     * otherwise we will go into an infinite loop if</span></div>
<div class="line"><a name="l03999"></a><span class="lineno"> 3999</span>&#160;<span class="comment">                     * the keyboard hook says to ignore the message.</span></div>
<div class="line"><a name="l04000"></a><span class="lineno"> 4000</span>&#160;<span class="comment">                     * (bobgu 4/7/87).</span></div>
<div class="line"><a name="l04001"></a><span class="lineno"> 4001</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04002"></a><span class="lineno"> 4002</span>&#160;                    <span class="keywordflow">if</span> (!fRemove) {</div>
<div class="line"><a name="l04003"></a><span class="lineno"> 4003</span>&#160;                        <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x10000);</div>
<div class="line"><a name="l04004"></a><span class="lineno"> 4004</span>&#160;                        <span class="keywordflow">goto</span> ContinueScan;</div>
<div class="line"><a name="l04005"></a><span class="lineno"> 4005</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04006"></a><span class="lineno"> 4006</span>&#160;                        <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x20000);</div>
<div class="line"><a name="l04007"></a><span class="lineno"> 4007</span>&#160;                        <span class="keywordflow">goto</span> RestartScan;</div>
<div class="line"><a name="l04008"></a><span class="lineno"> 4008</span>&#160;                    }</div>
<div class="line"><a name="l04009"></a><span class="lineno"> 4009</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04010"></a><span class="lineno"> 4010</span>&#160; </div>
<div class="line"><a name="l04011"></a><span class="lineno"> 4011</span>&#160;                <span class="keywordflow">case</span> <a class="code" href="a03290.html#a88031672cdc9e5f4f92f03caf1f65c81">MA_REHITTEST</a>:</div>
<div class="line"><a name="l04012"></a><span class="lineno"> 4012</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04013"></a><span class="lineno"> 4013</span>&#160;<span class="comment">                     * Reprocess the message.</span></div>
<div class="line"><a name="l04014"></a><span class="lineno"> 4014</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04015"></a><span class="lineno"> 4015</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x40000);</div>
<div class="line"><a name="l04016"></a><span class="lineno"> 4016</span>&#160;                    <span class="keywordflow">goto</span> ReprocessMsg;</div>
<div class="line"><a name="l04017"></a><span class="lineno"> 4017</span>&#160;                }</div>
<div class="line"><a name="l04018"></a><span class="lineno"> 4018</span>&#160;            }</div>
<div class="line"><a name="l04019"></a><span class="lineno"> 4019</span>&#160; </div>
<div class="line"><a name="l04020"></a><span class="lineno"> 4020</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04021"></a><span class="lineno"> 4021</span>&#160;<span class="comment">             * Eat the message from the input queue (and set the keystate</span></div>
<div class="line"><a name="l04022"></a><span class="lineno"> 4022</span>&#160;<span class="comment">             * table).</span></div>
<div class="line"><a name="l04023"></a><span class="lineno"> 4023</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04024"></a><span class="lineno"> 4024</span>&#160;            <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x80000);</div>
<div class="line"><a name="l04025"></a><span class="lineno"> 4025</span>&#160;            <span class="keywordflow">if</span> (fRemove) {</div>
<div class="line"><a name="l04026"></a><span class="lineno"> 4026</span>&#160;                <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l04027"></a><span class="lineno"> 4027</span>&#160;            }</div>
<div class="line"><a name="l04028"></a><span class="lineno"> 4028</span>&#160; </div>
<div class="line"><a name="l04029"></a><span class="lineno"> 4029</span>&#160;            <span class="keywordflow">if</span> (fRemove &amp;&amp; fMouseHookCalled &amp;&amp; IsHooked(ptiCurrent, WHF_CBT)) {</div>
<div class="line"><a name="l04030"></a><span class="lineno"> 4030</span>&#160;                <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HCBT_CLICKSKIPPED, message,</div>
<div class="line"><a name="l04031"></a><span class="lineno"> 4031</span>&#160;                        (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)&amp;mhs, WH_CBT);</div>
<div class="line"><a name="l04032"></a><span class="lineno"> 4032</span>&#160;            }</div>
<div class="line"><a name="l04033"></a><span class="lineno"> 4033</span>&#160;            fMouseHookCalled = FALSE;</div>
<div class="line"><a name="l04034"></a><span class="lineno"> 4034</span>&#160; </div>
<div class="line"><a name="l04035"></a><span class="lineno"> 4035</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04036"></a><span class="lineno"> 4036</span>&#160;<span class="comment">             * Calculate virtual key state bitmask for wParam.</span></div>
<div class="line"><a name="l04037"></a><span class="lineno"> 4037</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04038"></a><span class="lineno"> 4038</span>&#160;            <span class="keywordflow">if</span> (message &gt;= WM_MOUSEFIRST) {</div>
<div class="line"><a name="l04039"></a><span class="lineno"> 4039</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04040"></a><span class="lineno"> 4040</span>&#160;<span class="comment">                 * This is a USER mouse message. Calculate the bit mask for the</span></div>
<div class="line"><a name="l04041"></a><span class="lineno"> 4041</span>&#160;<span class="comment">                 * virtual key state.</span></div>
<div class="line"><a name="l04042"></a><span class="lineno"> 4042</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04043"></a><span class="lineno"> 4043</span>&#160;                wParam = <a class="code" href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb">GetMouseKeyFlags</a>(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>);</div>
<div class="line"><a name="l04044"></a><span class="lineno"> 4044</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x100000);</div>
<div class="line"><a name="l04045"></a><span class="lineno"> 4045</span>&#160;            }</div>
<div class="line"><a name="l04046"></a><span class="lineno"> 4046</span>&#160; </div>
<div class="line"><a name="l04047"></a><span class="lineno"> 4047</span>&#160;            lParam = MAKELONG((<span class="keywordtype">short</span>)pt.x, (<span class="keywordtype">short</span>)pt.y);</div>
<div class="line"><a name="l04048"></a><span class="lineno"> 4048</span>&#160;            <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x200000);</div>
<div class="line"><a name="l04049"></a><span class="lineno"> 4049</span>&#160;            <span class="keywordflow">goto</span> ReturnMessage;</div>
<div class="line"><a name="l04050"></a><span class="lineno"> 4050</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04051"></a><span class="lineno"> 4051</span>&#160; </div>
<div class="line"><a name="l04052"></a><span class="lineno"> 4052</span>&#160;        <span class="keywordflow">case</span> WM_KEYDOWN:</div>
<div class="line"><a name="l04053"></a><span class="lineno"> 4053</span>&#160;        <span class="keywordflow">case</span> WM_SYSKEYDOWN:</div>
<div class="line"><a name="l04054"></a><span class="lineno"> 4054</span>&#160;            fDown = TRUE;</div>
<div class="line"><a name="l04055"></a><span class="lineno"> 4055</span>&#160; </div>
<div class="line"><a name="l04056"></a><span class="lineno"> 4056</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04057"></a><span class="lineno"> 4057</span>&#160;<span class="comment">             * If we are sending keyboard input to an app that has been</span></div>
<div class="line"><a name="l04058"></a><span class="lineno"> 4058</span>&#160;<span class="comment">             * spinning then boost it back up.  If we don&#39;t you use spinning</span></div>
<div class="line"><a name="l04059"></a><span class="lineno"> 4059</span>&#160;<span class="comment">             * apps like Write or Project and do two builds in the</span></div>
<div class="line"><a name="l04060"></a><span class="lineno"> 4060</span>&#160;<span class="comment">             * background.  Note the app will also be unboosted again shortly</span></div>
<div class="line"><a name="l04061"></a><span class="lineno"> 4061</span>&#160;<span class="comment">             * after you stop typing by the old logic. #11188</span></div>
<div class="line"><a name="l04062"></a><span class="lineno"> 4062</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04063"></a><span class="lineno"> 4063</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING)</div>
<div class="line"><a name="l04064"></a><span class="lineno"> 4064</span>&#160;                <a class="code" href="a03290.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(ptiCurrent);</div>
<div class="line"><a name="l04065"></a><span class="lineno"> 4065</span>&#160; </div>
<div class="line"><a name="l04066"></a><span class="lineno"> 4066</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04067"></a><span class="lineno"> 4067</span>&#160;<span class="comment">             * Apps doing journal playback sometimes put trash in the hiword</span></div>
<div class="line"><a name="l04068"></a><span class="lineno"> 4068</span>&#160;<span class="comment">             * of wParam... zero it out here.</span></div>
<div class="line"><a name="l04069"></a><span class="lineno"> 4069</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04070"></a><span class="lineno"> 4070</span>&#160;            wParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam &amp; 0xFF;</div>
<div class="line"><a name="l04071"></a><span class="lineno"> 4071</span>&#160; </div>
<div class="line"><a name="l04072"></a><span class="lineno"> 4072</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04073"></a><span class="lineno"> 4073</span>&#160;<span class="comment">             * Clear QF_FMENUSTATUS if a key other than Alt it hit</span></div>
<div class="line"><a name="l04074"></a><span class="lineno"> 4074</span>&#160;<span class="comment">             * since this means the break of the Alt wouldn&#39;t be a</span></div>
<div class="line"><a name="l04075"></a><span class="lineno"> 4075</span>&#160;<span class="comment">             * menu key anymore.</span></div>
<div class="line"><a name="l04076"></a><span class="lineno"> 4076</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04077"></a><span class="lineno"> 4077</span>&#160;            <span class="keywordflow">if</span> (wParam != VK_MENU)</div>
<div class="line"><a name="l04078"></a><span class="lineno"> 4078</span>&#160;                ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~(QF_FMENUSTATUS|QF_FMENUSTATUSBREAK);</div>
<div class="line"><a name="l04079"></a><span class="lineno"> 4079</span>&#160; </div>
<div class="line"><a name="l04080"></a><span class="lineno"> 4080</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04081"></a><span class="lineno"> 4081</span>&#160;<span class="comment">             * Check if it is the PrintScrn key.</span></div>
<div class="line"><a name="l04082"></a><span class="lineno"> 4082</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04083"></a><span class="lineno"> 4083</span>&#160;            fAlt = TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, VK_MENU);</div>
<div class="line"><a name="l04084"></a><span class="lineno"> 4084</span>&#160;            <span class="keywordflow">if</span> (wParam == VK_SNAPSHOT &amp;&amp;</div>
<div class="line"><a name="l04085"></a><span class="lineno"> 4085</span>&#160;                ((fAlt &amp;&amp; !(ptiCurrent-&gt;<a class="code" href="a02889.html#a66a4fa1d0ee4c5d1b6d84a91a73a3f9f">fsReserveKeys</a> &amp; CONSOLE_ALTPRTSC)) ||</div>
<div class="line"><a name="l04086"></a><span class="lineno"> 4086</span>&#160;                 (!fAlt &amp;&amp; !(ptiCurrent-&gt;<a class="code" href="a02889.html#a66a4fa1d0ee4c5d1b6d84a91a73a3f9f">fsReserveKeys</a> &amp; CONSOLE_PRTSC)))) {</div>
<div class="line"><a name="l04087"></a><span class="lineno"> 4087</span>&#160; </div>
<div class="line"><a name="l04088"></a><span class="lineno"> 4088</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04089"></a><span class="lineno"> 4089</span>&#160;<span class="comment">                 * Remove this message from the input queue.</span></div>
<div class="line"><a name="l04090"></a><span class="lineno"> 4090</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04091"></a><span class="lineno"> 4091</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x400000);</div>
<div class="line"><a name="l04092"></a><span class="lineno"> 4092</span>&#160;                <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l04093"></a><span class="lineno"> 4093</span>&#160; </div>
<div class="line"><a name="l04094"></a><span class="lineno"> 4094</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04095"></a><span class="lineno"> 4095</span>&#160;<span class="comment">                 * PRINTSCREEN          -&gt; Snap the whole screen.</span></div>
<div class="line"><a name="l04096"></a><span class="lineno"> 4096</span>&#160;<span class="comment">                 * ALT-PRINTSCREEN      -&gt; Snap the current window.</span></div>
<div class="line"><a name="l04097"></a><span class="lineno"> 4097</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04098"></a><span class="lineno"> 4098</span>&#160;                pwndT = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>;</div>
<div class="line"><a name="l04099"></a><span class="lineno"> 4099</span>&#160;                <span class="keywordflow">if</span> (!fAlt) {</div>
<div class="line"><a name="l04100"></a><span class="lineno"> 4100</span>&#160;                    pwndT = ptiCurrent-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>;</div>
<div class="line"><a name="l04101"></a><span class="lineno"> 4101</span>&#160;                }</div>
<div class="line"><a name="l04102"></a><span class="lineno"> 4102</span>&#160; </div>
<div class="line"><a name="l04103"></a><span class="lineno"> 4103</span>&#160;                <span class="keywordflow">if</span> (pwndT != NULL) {</div>
<div class="line"><a name="l04104"></a><span class="lineno"> 4104</span>&#160;                    ThreadLockAlwaysWithPti(ptiCurrent, pwndT, &amp;tlpwndT);</div>
<div class="line"><a name="l04105"></a><span class="lineno"> 4105</span>&#160;                    <a class="code" href="a00857.html#a69ab51ee72ab28ff78e0a7f2f902825b">xxxSnapWindow</a>(pwndT);</div>
<div class="line"><a name="l04106"></a><span class="lineno"> 4106</span>&#160;                    ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l04107"></a><span class="lineno"> 4107</span>&#160;                }</div>
<div class="line"><a name="l04108"></a><span class="lineno"> 4108</span>&#160; </div>
<div class="line"><a name="l04109"></a><span class="lineno"> 4109</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x800000);</div>
<div class="line"><a name="l04110"></a><span class="lineno"> 4110</span>&#160;                <span class="keywordflow">goto</span> RestartScan;</div>
<div class="line"><a name="l04111"></a><span class="lineno"> 4111</span>&#160;            }</div>
<div class="line"><a name="l04112"></a><span class="lineno"> 4112</span>&#160; </div>
<div class="line"><a name="l04113"></a><span class="lineno"> 4113</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04114"></a><span class="lineno"> 4114</span>&#160;<span class="comment">             * Check for keyboard language toggle.  Build the key state</span></div>
<div class="line"><a name="l04115"></a><span class="lineno"> 4115</span>&#160;<span class="comment">             * here for use during key up processing (where the layout</span></div>
<div class="line"><a name="l04116"></a><span class="lineno"> 4116</span>&#160;<span class="comment">             * switching takes place.  This code is skipped if layout</span></div>
<div class="line"><a name="l04117"></a><span class="lineno"> 4117</span>&#160;<span class="comment">             * switching via the keyboard is disabled.</span></div>
<div class="line"><a name="l04118"></a><span class="lineno"> 4118</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04119"></a><span class="lineno"> 4119</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[0].bVkey &amp;&amp; (<a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> &lt; 8)) {</div>
<div class="line"><a name="l04120"></a><span class="lineno"> 4120</span>&#160;                <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> i;</div>
<div class="line"><a name="l04121"></a><span class="lineno"> 4121</span>&#160;                BYTE scancode = LOBYTE(HIWORD(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam));</div>
<div class="line"><a name="l04122"></a><span class="lineno"> 4122</span>&#160;                BYTE vkey = LOBYTE(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l04123"></a><span class="lineno"> 4123</span>&#160; </div>
<div class="line"><a name="l04124"></a><span class="lineno"> 4124</span>&#160;                <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="a03257.html#ac33ef58925731203e45c9e6e6932c198">cLangToggleKeys</a>; i++) {</div>
<div class="line"><a name="l04125"></a><span class="lineno"> 4125</span>&#160;                    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].bScan) {</div>
<div class="line"><a name="l04126"></a><span class="lineno"> 4126</span>&#160;                        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].bScan == scancode) {</div>
<div class="line"><a name="l04127"></a><span class="lineno"> 4127</span>&#160;                            <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> |= <a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].<a class="code" href="a02797.html#a91ec88444118f8013721fdd6141958ba">iBitPosition</a>;</div>
<div class="line"><a name="l04128"></a><span class="lineno"> 4128</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04129"></a><span class="lineno"> 4129</span>&#160;                        }</div>
<div class="line"><a name="l04130"></a><span class="lineno"> 4130</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04131"></a><span class="lineno"> 4131</span>&#160;                        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].bVkey == vkey) {</div>
<div class="line"><a name="l04132"></a><span class="lineno"> 4132</span>&#160;                            <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> |= <a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].<a class="code" href="a02797.html#a91ec88444118f8013721fdd6141958ba">iBitPosition</a>;</div>
<div class="line"><a name="l04133"></a><span class="lineno"> 4133</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04134"></a><span class="lineno"> 4134</span>&#160;                        }</div>
<div class="line"><a name="l04135"></a><span class="lineno"> 4135</span>&#160;                    }</div>
<div class="line"><a name="l04136"></a><span class="lineno"> 4136</span>&#160;                }</div>
<div class="line"><a name="l04137"></a><span class="lineno"> 4137</span>&#160; </div>
<div class="line"><a name="l04138"></a><span class="lineno"> 4138</span>&#160;                <span class="keywordflow">if</span> (i == <a class="code" href="a03257.html#ac33ef58925731203e45c9e6e6932c198">cLangToggleKeys</a>) {</div>
<div class="line"><a name="l04139"></a><span class="lineno"> 4139</span>&#160;                    <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> = 8;   <span class="comment">// not a language toggle combination</span></div>
<div class="line"><a name="l04140"></a><span class="lineno"> 4140</span>&#160;                }</div>
<div class="line"><a name="l04141"></a><span class="lineno"> 4141</span>&#160;            }</div>
<div class="line"><a name="l04142"></a><span class="lineno"> 4142</span>&#160; </div>
<div class="line"><a name="l04143"></a><span class="lineno"> 4143</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04144"></a><span class="lineno"> 4144</span>&#160;<span class="comment">             * Check for hot keys being hit if any are defined.</span></div>
<div class="line"><a name="l04145"></a><span class="lineno"> 4145</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04146"></a><span class="lineno"> 4146</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#ad79c05a04d897d68910afd81af0c797d">gcHotKey</a> != 0) {</div>
<div class="line"><a name="l04147"></a><span class="lineno"> 4147</span>&#160;                <a class="code" href="a00377.html#af1128a676756d86f949094178c96d93b">key</a> = wParam;</div>
<div class="line"><a name="l04148"></a><span class="lineno"> 4148</span>&#160; </div>
<div class="line"><a name="l04149"></a><span class="lineno"> 4149</span>&#160;                <span class="keywordflow">if</span> (TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, VK_MENU))</div>
<div class="line"><a name="l04150"></a><span class="lineno"> 4150</span>&#160;                    <a class="code" href="a00377.html#af1128a676756d86f949094178c96d93b">key</a> |= 0x0400;</div>
<div class="line"><a name="l04151"></a><span class="lineno"> 4151</span>&#160; </div>
<div class="line"><a name="l04152"></a><span class="lineno"> 4152</span>&#160;                <span class="keywordflow">if</span> (TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, VK_CONTROL))</div>
<div class="line"><a name="l04153"></a><span class="lineno"> 4153</span>&#160;                    <a class="code" href="a00377.html#af1128a676756d86f949094178c96d93b">key</a> |= 0x0200;</div>
<div class="line"><a name="l04154"></a><span class="lineno"> 4154</span>&#160; </div>
<div class="line"><a name="l04155"></a><span class="lineno"> 4155</span>&#160;                <span class="keywordflow">if</span> (TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, VK_SHIFT))</div>
<div class="line"><a name="l04156"></a><span class="lineno"> 4156</span>&#160;                    <a class="code" href="a00377.html#af1128a676756d86f949094178c96d93b">key</a> |= 0x0100;</div>
<div class="line"><a name="l04157"></a><span class="lineno"> 4157</span>&#160; </div>
<div class="line"><a name="l04158"></a><span class="lineno"> 4158</span>&#160;                pwndT = <a class="code" href="a00899.html#aa8e750304c0b123842e49af384460e26">HotKeyToWindow</a>(<a class="code" href="a00377.html#af1128a676756d86f949094178c96d93b">key</a>);</div>
<div class="line"><a name="l04159"></a><span class="lineno"> 4159</span>&#160; </div>
<div class="line"><a name="l04160"></a><span class="lineno"> 4160</span>&#160;                <span class="keywordflow">if</span> (pwndT != NULL) {</div>
<div class="line"><a name="l04161"></a><span class="lineno"> 4161</span>&#160;                    <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>, WM_SYSCOMMAND,</div>
<div class="line"><a name="l04162"></a><span class="lineno"> 4162</span>&#160;                                (WPARAM)SC_HOTKEY, (LONG)HWq(pwndT));</div>
<div class="line"><a name="l04163"></a><span class="lineno"> 4163</span>&#160; </div>
<div class="line"><a name="l04164"></a><span class="lineno"> 4164</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04165"></a><span class="lineno"> 4165</span>&#160;<span class="comment">                     * Remove this message from the input queue.</span></div>
<div class="line"><a name="l04166"></a><span class="lineno"> 4166</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04167"></a><span class="lineno"> 4167</span>&#160;                    <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l04168"></a><span class="lineno"> 4168</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x1000000);</div>
<div class="line"><a name="l04169"></a><span class="lineno"> 4169</span>&#160;                    <span class="keywordflow">goto</span> RestartScan;</div>
<div class="line"><a name="l04170"></a><span class="lineno"> 4170</span>&#160;                }</div>
<div class="line"><a name="l04171"></a><span class="lineno"> 4171</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x2000000);</div>
<div class="line"><a name="l04172"></a><span class="lineno"> 4172</span>&#160;            }</div>
<div class="line"><a name="l04173"></a><span class="lineno"> 4173</span>&#160; </div>
<div class="line"><a name="l04174"></a><span class="lineno"> 4174</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04175"></a><span class="lineno"> 4175</span>&#160;<span class="comment">             * Fall through.</span></div>
<div class="line"><a name="l04176"></a><span class="lineno"> 4176</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04177"></a><span class="lineno"> 4177</span>&#160; </div>
<div class="line"><a name="l04178"></a><span class="lineno"> 4178</span>&#160;        <span class="keywordflow">case</span> WM_SYSKEYUP:</div>
<div class="line"><a name="l04179"></a><span class="lineno"> 4179</span>&#160;        <span class="keywordflow">case</span> WM_KEYUP:</div>
<div class="line"><a name="l04180"></a><span class="lineno"> 4180</span>&#160;            wParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam &amp; 0xFF;</div>
<div class="line"><a name="l04181"></a><span class="lineno"> 4181</span>&#160; </div>
<div class="line"><a name="l04182"></a><span class="lineno"> 4182</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04183"></a><span class="lineno"> 4183</span>&#160;<span class="comment">             * Process keyboard toggle keys only if this is</span></div>
<div class="line"><a name="l04184"></a><span class="lineno"> 4184</span>&#160;<span class="comment">             * a break event and fRemove == TRUE.  Some apps,</span></div>
<div class="line"><a name="l04185"></a><span class="lineno"> 4185</span>&#160;<span class="comment">             * for instance Word 95, call PeekMessage with</span></div>
<div class="line"><a name="l04186"></a><span class="lineno"> 4186</span>&#160;<span class="comment">             * PM_NOREMOVE followed by a call with PM_REMOVE.</span></div>
<div class="line"><a name="l04187"></a><span class="lineno"> 4187</span>&#160;<span class="comment">             * We only want to process this once.  Skip all</span></div>
<div class="line"><a name="l04188"></a><span class="lineno"> 4188</span>&#160;<span class="comment">             * of this is layout switching via the keyboard</span></div>
<div class="line"><a name="l04189"></a><span class="lineno"> 4189</span>&#160;<span class="comment">             * is disabled.</span></div>
<div class="line"><a name="l04190"></a><span class="lineno"> 4190</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04191"></a><span class="lineno"> 4191</span>&#160;            <span class="keywordflow">if</span> (!fDown &amp;&amp; fRemove &amp;&amp; <a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[0].bVkey) {</div>
<div class="line"><a name="l04192"></a><span class="lineno"> 4192</span>&#160;                BOOL bDropToggle = FALSE;</div>
<div class="line"><a name="l04193"></a><span class="lineno"> 4193</span>&#160;                <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwDirection = 0;</div>
<div class="line"><a name="l04194"></a><span class="lineno"> 4194</span>&#160;                <a class="code" href="a02793.html">PKL</a> pkl;</div>
<div class="line"><a name="l04195"></a><span class="lineno"> 4195</span>&#160;                <span class="comment">// PWND pwndTop;</span></div>
<div class="line"><a name="l04196"></a><span class="lineno"> 4196</span>&#160; </div>
<div class="line"><a name="l04197"></a><span class="lineno"> 4197</span>&#160;                pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>;</div>
<div class="line"><a name="l04198"></a><span class="lineno"> 4198</span>&#160;                <span class="keywordflow">if</span> (pwnd == NULL) {</div>
<div class="line"><a name="l04199"></a><span class="lineno"> 4199</span>&#160;                    pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>;</div>
<div class="line"><a name="l04200"></a><span class="lineno"> 4200</span>&#160;                    <span class="keywordflow">if</span> (!pwnd) {</div>
<div class="line"><a name="l04201"></a><span class="lineno"> 4201</span>&#160;                        <span class="keywordflow">goto</span> NoLayoutSwitch;</div>
<div class="line"><a name="l04202"></a><span class="lineno"> 4202</span>&#160;                    }</div>
<div class="line"><a name="l04203"></a><span class="lineno"> 4203</span>&#160;                }</div>
<div class="line"><a name="l04204"></a><span class="lineno"> 4204</span>&#160;                pkl = GETPTI(pwnd)-&gt;spklActive;</div>
<div class="line"><a name="l04205"></a><span class="lineno"> 4205</span>&#160;                <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pkl != NULL);</div>
<div class="line"><a name="l04206"></a><span class="lineno"> 4206</span>&#160; </div>
<div class="line"><a name="l04207"></a><span class="lineno"> 4207</span>&#160;                <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a>) {</div>
<div class="line"><a name="l04208"></a><span class="lineno"> 4208</span>&#160; </div>
<div class="line"><a name="l04209"></a><span class="lineno"> 4209</span>&#160;                <span class="keywordflow">case</span> KLT_LEFTSHIFT:</div>
<div class="line"><a name="l04210"></a><span class="lineno"> 4210</span>&#160;                   bDropToggle = TRUE;</div>
<div class="line"><a name="l04211"></a><span class="lineno"> 4211</span>&#160;                   dwDirection = LANGCHANGE_BACKWARD;</div>
<div class="line"><a name="l04212"></a><span class="lineno"> 4212</span>&#160;                   pkl = <a class="code" href="a00725.html#ab8998458d1938a03a802e2b887dcb3d0">HKLtoPKL</a>((HKL)HKL_NEXT);</div>
<div class="line"><a name="l04213"></a><span class="lineno"> 4213</span>&#160;                   <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04214"></a><span class="lineno"> 4214</span>&#160; </div>
<div class="line"><a name="l04215"></a><span class="lineno"> 4215</span>&#160;                <span class="keywordflow">case</span> KLT_RIGHTSHIFT:</div>
<div class="line"><a name="l04216"></a><span class="lineno"> 4216</span>&#160;                   bDropToggle = TRUE;</div>
<div class="line"><a name="l04217"></a><span class="lineno"> 4217</span>&#160;                   dwDirection = LANGCHANGE_FORWARD;</div>
<div class="line"><a name="l04218"></a><span class="lineno"> 4218</span>&#160;                   pkl = <a class="code" href="a00725.html#ab8998458d1938a03a802e2b887dcb3d0">HKLtoPKL</a>((HKL)HKL_PREV);</div>
<div class="line"><a name="l04219"></a><span class="lineno"> 4219</span>&#160;                   <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04220"></a><span class="lineno"> 4220</span>&#160; </div>
<div class="line"><a name="l04221"></a><span class="lineno"> 4221</span>&#160;                <span class="keywordflow">case</span> KLT_BOTHSHIFTS:</div>
<div class="line"><a name="l04222"></a><span class="lineno"> 4222</span>&#160;                   pkl = <a class="code" href="a03257.html#a25f03eea622def9f9059f147118d2dcb">gspklBaseLayout</a>;</div>
<div class="line"><a name="l04223"></a><span class="lineno"> 4223</span>&#160;                   <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04224"></a><span class="lineno"> 4224</span>&#160; </div>
<div class="line"><a name="l04225"></a><span class="lineno"> 4225</span>&#160;                <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l04226"></a><span class="lineno"> 4226</span>&#160;                   <span class="keywordflow">goto</span> NoLayoutSwitch;</div>
<div class="line"><a name="l04227"></a><span class="lineno"> 4227</span>&#160;                   <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04228"></a><span class="lineno"> 4228</span>&#160;                }</div>
<div class="line"><a name="l04229"></a><span class="lineno"> 4229</span>&#160; </div>
<div class="line"><a name="l04230"></a><span class="lineno"> 4230</span>&#160;                <span class="keywordflow">if</span> (pkl == NULL) {</div>
<div class="line"><a name="l04231"></a><span class="lineno"> 4231</span>&#160;                    pkl = GETPTI(pwnd)-&gt;spklActive;</div>
<div class="line"><a name="l04232"></a><span class="lineno"> 4232</span>&#160;                }</div>
<div class="line"><a name="l04233"></a><span class="lineno"> 4233</span>&#160; </div>
<div class="line"><a name="l04234"></a><span class="lineno"> 4234</span>&#160;                <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(<a class="code" href="a03257.html#a25f03eea622def9f9059f147118d2dcb">gspklBaseLayout</a> != NULL);</div>
<div class="line"><a name="l04235"></a><span class="lineno"> 4235</span>&#160; </div>
<div class="line"><a name="l04236"></a><span class="lineno"> 4236</span>&#160;                <span class="comment">// One day Memphis and Windows NT should come up with a better</span></div>
<div class="line"><a name="l04237"></a><span class="lineno"> 4237</span>&#160;                <span class="comment">// strategy.  This one goes up too far, bypassing Word when</span></div>
<div class="line"><a name="l04238"></a><span class="lineno"> 4238</span>&#160;                <span class="comment">// using wordmail. - IanJa</span></div>
<div class="line"><a name="l04239"></a><span class="lineno"> 4239</span>&#160;                <span class="comment">// if ((pwndTop = GetTopLevelWindow(pwnd)) != NULL) {</span></div>
<div class="line"><a name="l04240"></a><span class="lineno"> 4240</span>&#160;                <span class="comment">//    pwnd = pwndTop;</span></div>
<div class="line"><a name="l04241"></a><span class="lineno"> 4241</span>&#160;                <span class="comment">// }</span></div>
<div class="line"><a name="l04242"></a><span class="lineno"> 4242</span>&#160;                <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(</div>
<div class="line"><a name="l04243"></a><span class="lineno"> 4243</span>&#160;                    pwnd,</div>
<div class="line"><a name="l04244"></a><span class="lineno"> 4244</span>&#160;                    WM_INPUTLANGCHANGEREQUEST,</div>
<div class="line"><a name="l04245"></a><span class="lineno"> 4245</span>&#160;                    (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)(((pkl-&gt;<a class="code" href="a02793.html#ae380510bc898c92bcab23892035c8aa2">bCharsets</a> &amp; <a class="code" href="a03257.html#a53d970087b4067811d99a3001abe20fa">gSystemCPB</a>) ? TRUE : FALSE) | dwDirection),</div>
<div class="line"><a name="l04246"></a><span class="lineno"> 4246</span>&#160;                    (LONG)pkl-&gt;<a class="code" href="a02793.html#a44bfbf1bad1abd1c46618c96f982aec4">hkl</a></div>
<div class="line"><a name="l04247"></a><span class="lineno"> 4247</span>&#160;                    );</div>
<div class="line"><a name="l04248"></a><span class="lineno"> 4248</span>&#160; </div>
<div class="line"><a name="l04249"></a><span class="lineno"> 4249</span>&#160;NoLayoutSwitch:</div>
<div class="line"><a name="l04250"></a><span class="lineno"> 4250</span>&#160; </div>
<div class="line"><a name="l04251"></a><span class="lineno"> 4251</span>&#160;                <span class="keywordflow">if</span> (bDropToggle) {</div>
<div class="line"><a name="l04252"></a><span class="lineno"> 4252</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04253"></a><span class="lineno"> 4253</span>&#160;<span class="comment">                     * Clear this key from the key state so that multiple key</span></div>
<div class="line"><a name="l04254"></a><span class="lineno"> 4254</span>&#160;<span class="comment">                     * presses will work (i.e., Alt+Shft+Shft).  We don&#39;t do</span></div>
<div class="line"><a name="l04255"></a><span class="lineno"> 4255</span>&#160;<span class="comment">                     * this when both shift keys are pressed simultaneously to</span></div>
<div class="line"><a name="l04256"></a><span class="lineno"> 4256</span>&#160;<span class="comment">                     * avoid two activates.</span></div>
<div class="line"><a name="l04257"></a><span class="lineno"> 4257</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04258"></a><span class="lineno"> 4258</span>&#160;                    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> i;</div>
<div class="line"><a name="l04259"></a><span class="lineno"> 4259</span>&#160;                    BYTE scancode = LOBYTE(HIWORD(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam));</div>
<div class="line"><a name="l04260"></a><span class="lineno"> 4260</span>&#160;                    BYTE vkey = LOBYTE(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l04261"></a><span class="lineno"> 4261</span>&#160; </div>
<div class="line"><a name="l04262"></a><span class="lineno"> 4262</span>&#160;                    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="a03257.html#ac33ef58925731203e45c9e6e6932c198">cLangToggleKeys</a>; i++) {</div>
<div class="line"><a name="l04263"></a><span class="lineno"> 4263</span>&#160;                        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].bScan) {</div>
<div class="line"><a name="l04264"></a><span class="lineno"> 4264</span>&#160;                            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].bScan == scancode) {</div>
<div class="line"><a name="l04265"></a><span class="lineno"> 4265</span>&#160;                                <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> &amp;= ~(<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].<a class="code" href="a02797.html#a91ec88444118f8013721fdd6141958ba">iBitPosition</a>);</div>
<div class="line"><a name="l04266"></a><span class="lineno"> 4266</span>&#160;                            }</div>
<div class="line"><a name="l04267"></a><span class="lineno"> 4267</span>&#160;                        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04268"></a><span class="lineno"> 4268</span>&#160;                            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].bVkey == vkey) {</div>
<div class="line"><a name="l04269"></a><span class="lineno"> 4269</span>&#160;                                <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> &amp;= ~(<a class="code" href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a>[i].<a class="code" href="a02797.html#a91ec88444118f8013721fdd6141958ba">iBitPosition</a>);</div>
<div class="line"><a name="l04270"></a><span class="lineno"> 4270</span>&#160;                            }</div>
<div class="line"><a name="l04271"></a><span class="lineno"> 4271</span>&#160;                        }</div>
<div class="line"><a name="l04272"></a><span class="lineno"> 4272</span>&#160;                    }</div>
<div class="line"><a name="l04273"></a><span class="lineno"> 4273</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04274"></a><span class="lineno"> 4274</span>&#160;                    <a class="code" href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a> = 0;</div>
<div class="line"><a name="l04275"></a><span class="lineno"> 4275</span>&#160;                }</div>
<div class="line"><a name="l04276"></a><span class="lineno"> 4276</span>&#160;            }</div>
<div class="line"><a name="l04277"></a><span class="lineno"> 4277</span>&#160; </div>
<div class="line"><a name="l04278"></a><span class="lineno"> 4278</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04279"></a><span class="lineno"> 4279</span>&#160;<span class="comment">             * Convert F10 to syskey for new apps.</span></div>
<div class="line"><a name="l04280"></a><span class="lineno"> 4280</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04281"></a><span class="lineno"> 4281</span>&#160;            <span class="keywordflow">if</span> (wParam == VK_F10)</div>
<div class="line"><a name="l04282"></a><span class="lineno"> 4282</span>&#160;                message |= (WM_SYSKEYDOWN - WM_KEYDOWN);</div>
<div class="line"><a name="l04283"></a><span class="lineno"> 4283</span>&#160; </div>
<div class="line"><a name="l04284"></a><span class="lineno"> 4284</span>&#160;            <span class="keywordflow">if</span> (TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, VK_CONTROL) &amp;&amp;</div>
<div class="line"><a name="l04285"></a><span class="lineno"> 4285</span>&#160;                    wParam == VK_ESCAPE) {</div>
<div class="line"><a name="l04286"></a><span class="lineno"> 4286</span>&#160;                message |= (WM_SYSKEYDOWN - WM_KEYDOWN);</div>
<div class="line"><a name="l04287"></a><span class="lineno"> 4287</span>&#160;            }</div>
<div class="line"><a name="l04288"></a><span class="lineno"> 4288</span>&#160; </div>
<div class="line"><a name="l04289"></a><span class="lineno"> 4289</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04290"></a><span class="lineno"> 4290</span>&#160;<span class="comment">             * Clear the &#39;simulated keystroke&#39; bit for all applications except</span></div>
<div class="line"><a name="l04291"></a><span class="lineno"> 4291</span>&#160;<span class="comment">             * console so it can pass it to 16-bit vdms. VDM keyboards need to</span></div>
<div class="line"><a name="l04292"></a><span class="lineno"> 4292</span>&#160;<span class="comment">             * distinguish between AltGr (where Ctrl keystroke is simulated)</span></div>
<div class="line"><a name="l04293"></a><span class="lineno"> 4293</span>&#160;<span class="comment">             * and a real Ctrl+Alt. Check TIF_CSRSSTHREAD for the console</span></div>
<div class="line"><a name="l04294"></a><span class="lineno"> 4294</span>&#160;<span class="comment">             * input thread because it lives in the server. This is a cheap</span></div>
<div class="line"><a name="l04295"></a><span class="lineno"> 4295</span>&#160;<span class="comment">             * way to check for it.</span></div>
<div class="line"><a name="l04296"></a><span class="lineno"> 4296</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04297"></a><span class="lineno"> 4297</span>&#160;            <span class="keywordflow">if</span> (!(ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_CSRSSTHREAD))</div>
<div class="line"><a name="l04298"></a><span class="lineno"> 4298</span>&#160;                qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam &amp;= ~<a class="code" href="a00347.html#ae16e833a609f99656ad41979a79aeb72">FAKE_KEYSTROKE</a>;</div>
<div class="line"><a name="l04299"></a><span class="lineno"> 4299</span>&#160;            <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x4000000);</div>
<div class="line"><a name="l04300"></a><span class="lineno"> 4300</span>&#160; </div>
<div class="line"><a name="l04301"></a><span class="lineno"> 4301</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04302"></a><span class="lineno"> 4302</span>&#160;<span class="comment">             * Fall through.</span></div>
<div class="line"><a name="l04303"></a><span class="lineno"> 4303</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04304"></a><span class="lineno"> 4304</span>&#160; </div>
<div class="line"><a name="l04305"></a><span class="lineno"> 4305</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04306"></a><span class="lineno"> 4306</span>&#160;<span class="comment">             * Some apps want to be able to feed WM_CHAR messages through</span></div>
<div class="line"><a name="l04307"></a><span class="lineno"> 4307</span>&#160;<span class="comment">             * the playback hook. Why? Because they want to be able to</span></div>
<div class="line"><a name="l04308"></a><span class="lineno"> 4308</span>&#160;<span class="comment">             * convert a string of characters info key messages</span></div>
<div class="line"><a name="l04309"></a><span class="lineno"> 4309</span>&#160;<span class="comment">             * and feed them to themselves or other apps. Unfortunately,</span></div>
<div class="line"><a name="l04310"></a><span class="lineno"> 4310</span>&#160;<span class="comment">             * there are no machine independent virtual key codes for</span></div>
<div class="line"><a name="l04311"></a><span class="lineno"> 4311</span>&#160;<span class="comment">             * some characters (for example &#39;$&#39;), so they need to send</span></div>
<div class="line"><a name="l04312"></a><span class="lineno"> 4312</span>&#160;<span class="comment">             * those through as WM_CHARs. (6/10/87).</span></div>
<div class="line"><a name="l04313"></a><span class="lineno"> 4313</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04314"></a><span class="lineno"> 4314</span>&#160; </div>
<div class="line"><a name="l04315"></a><span class="lineno"> 4315</span>&#160;        <span class="keywordflow">case</span> WM_CHAR:</div>
<div class="line"><a name="l04316"></a><span class="lineno"> 4316</span>&#160;            wParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam &amp; 0xFF;</div>
<div class="line"><a name="l04317"></a><span class="lineno"> 4317</span>&#160; </div>
<div class="line"><a name="l04318"></a><span class="lineno"> 4318</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04319"></a><span class="lineno"> 4319</span>&#160;<span class="comment">             * Assign the input to the focus window. If there is no focus</span></div>
<div class="line"><a name="l04320"></a><span class="lineno"> 4320</span>&#160;<span class="comment">             * window, assign it to the active window as a SYS message.</span></div>
<div class="line"><a name="l04321"></a><span class="lineno"> 4321</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04322"></a><span class="lineno"> 4322</span>&#160;            pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>;</div>
<div class="line"><a name="l04323"></a><span class="lineno"> 4323</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a> == NULL) {</div>
<div class="line"><a name="l04324"></a><span class="lineno"> 4324</span>&#160;                <span class="keywordflow">if</span> ((pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>) != NULL) {</div>
<div class="line"><a name="l04325"></a><span class="lineno"> 4325</span>&#160;                    <span class="keywordflow">if</span> (CheckMsgFilter(message, WM_KEYDOWN, WM_DEADCHAR)) {</div>
<div class="line"><a name="l04326"></a><span class="lineno"> 4326</span>&#160;                        message += (WM_SYSKEYDOWN - WM_KEYDOWN);</div>
<div class="line"><a name="l04327"></a><span class="lineno"> 4327</span>&#160;                        <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x8000000);</div>
<div class="line"><a name="l04328"></a><span class="lineno"> 4328</span>&#160;                    }</div>
<div class="line"><a name="l04329"></a><span class="lineno"> 4329</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04330"></a><span class="lineno"> 4330</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x10000000);</div>
<div class="line"><a name="l04331"></a><span class="lineno"> 4331</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04332"></a><span class="lineno"> 4332</span>&#160;                }</div>
<div class="line"><a name="l04333"></a><span class="lineno"> 4333</span>&#160;            }</div>
<div class="line"><a name="l04334"></a><span class="lineno"> 4334</span>&#160; </div>
<div class="line"><a name="l04335"></a><span class="lineno"> 4335</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04336"></a><span class="lineno"> 4336</span>&#160;<span class="comment">             * If there is no active window or focus window, eat this</span></div>
<div class="line"><a name="l04337"></a><span class="lineno"> 4337</span>&#160;<span class="comment">             * message.</span></div>
<div class="line"><a name="l04338"></a><span class="lineno"> 4338</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04339"></a><span class="lineno"> 4339</span>&#160;            <span class="keywordflow">if</span> (pwnd == NULL) {</div>
<div class="line"><a name="l04340"></a><span class="lineno"> 4340</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x20000000);</div>
<div class="line"><a name="l04341"></a><span class="lineno"> 4341</span>&#160;                <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04342"></a><span class="lineno"> 4342</span>&#160;            }</div>
<div class="line"><a name="l04343"></a><span class="lineno"> 4343</span>&#160; </div>
<div class="line"><a name="l04344"></a><span class="lineno"> 4344</span>&#160;            ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l04345"></a><span class="lineno"> 4345</span>&#160;            ThreadLockAlwaysWithPti(ptiCurrent, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l04346"></a><span class="lineno"> 4346</span>&#160; </div>
<div class="line"><a name="l04347"></a><span class="lineno"> 4347</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04348"></a><span class="lineno"> 4348</span>&#160;<span class="comment">             * Check if this is intended for the current app.</span></div>
<div class="line"><a name="l04349"></a><span class="lineno"> 4349</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04350"></a><span class="lineno"> 4350</span>&#160;            <span class="keywordflow">if</span> (fOtherApp = (GETPTI(pwnd) != ptiCurrent)) {</div>
<div class="line"><a name="l04351"></a><span class="lineno"> 4351</span>&#160; </div>
<div class="line"><a name="l04352"></a><span class="lineno"> 4352</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04353"></a><span class="lineno"> 4353</span>&#160;<span class="comment">                 * If this other app isn&#39;t going to read from this</span></div>
<div class="line"><a name="l04354"></a><span class="lineno"> 4354</span>&#160;<span class="comment">                 * queue, then skip this message. This can happen if</span></div>
<div class="line"><a name="l04355"></a><span class="lineno"> 4355</span>&#160;<span class="comment">                 * the RIT queues up a message thinking it goes to</span></div>
<div class="line"><a name="l04356"></a><span class="lineno"> 4356</span>&#160;<span class="comment">                 * a particular hwnd, but then by the time GetMessage()</span></div>
<div class="line"><a name="l04357"></a><span class="lineno"> 4357</span>&#160;<span class="comment">                 * is called for that thread, it doesn&#39;t go to that hwnd</span></div>
<div class="line"><a name="l04358"></a><span class="lineno"> 4358</span>&#160;<span class="comment">                 * (like in the case of mouse messages, window rearrangement</span></div>
<div class="line"><a name="l04359"></a><span class="lineno"> 4359</span>&#160;<span class="comment">                 * happens which changes which hwnd the mouse hits on).</span></div>
<div class="line"><a name="l04360"></a><span class="lineno"> 4360</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04361"></a><span class="lineno"> 4361</span>&#160;                <span class="keywordflow">if</span> (GETPTI(pwnd)-&gt;pq != ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) {</div>
<div class="line"><a name="l04362"></a><span class="lineno"> 4362</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x40000000);</div>
<div class="line"><a name="l04363"></a><span class="lineno"> 4363</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04364"></a><span class="lineno"> 4364</span>&#160;                }</div>
<div class="line"><a name="l04365"></a><span class="lineno"> 4365</span>&#160; </div>
<div class="line"><a name="l04366"></a><span class="lineno"> 4366</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04367"></a><span class="lineno"> 4367</span>&#160;<span class="comment">                 * If the current thread is in the menu loop then we need</span></div>
<div class="line"><a name="l04368"></a><span class="lineno"> 4368</span>&#160;<span class="comment">                 * to give it the input</span></div>
<div class="line"><a name="l04369"></a><span class="lineno"> 4369</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04370"></a><span class="lineno"> 4370</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="a00899.html#af22598950c2f41d596373168bd1e15ef">IsInsideMenuLoop</a>(ptiCurrent)) {</div>
<div class="line"><a name="l04371"></a><span class="lineno"> 4371</span>&#160;                    pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a>-&gt;<a class="code" href="a02885.html#abfc93aac8825e9638c90a2fbb8bca855">pGlobalPopupMenu</a>-&gt;<a class="code" href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">spwndNotify</a>;</div>
<div class="line"><a name="l04372"></a><span class="lineno"> 4372</span>&#160;                    fOtherApp = (GETPTI(pwnd) != ptiCurrent);</div>
<div class="line"><a name="l04373"></a><span class="lineno"> 4373</span>&#160; </div>
<div class="line"><a name="l04374"></a><span class="lineno"> 4374</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04375"></a><span class="lineno"> 4375</span>&#160;<span class="comment">                     * We&#39;ve reassigned pwnd, so lock it.</span></div>
<div class="line"><a name="l04376"></a><span class="lineno"> 4376</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04377"></a><span class="lineno"> 4377</span>&#160;                    ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l04378"></a><span class="lineno"> 4378</span>&#160;                    ThreadLockWithPti(ptiCurrent, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l04379"></a><span class="lineno"> 4379</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x80000000);</div>
<div class="line"><a name="l04380"></a><span class="lineno"> 4380</span>&#160;                }</div>
<div class="line"><a name="l04381"></a><span class="lineno"> 4381</span>&#160; </div>
<div class="line"><a name="l04382"></a><span class="lineno"> 4382</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04383"></a><span class="lineno"> 4383</span>&#160;<span class="comment">                 * If not for us, then remember who it is for.</span></div>
<div class="line"><a name="l04384"></a><span class="lineno"> 4384</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04385"></a><span class="lineno"> 4385</span>&#160;                <span class="keywordflow">if</span> (ptiKeyWake == NULL) {</div>
<div class="line"><a name="l04386"></a><span class="lineno"> 4386</span>&#160;                    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(1);</div>
<div class="line"><a name="l04387"></a><span class="lineno"> 4387</span>&#160;                    ptiKeyWake = GETPTI(pwnd);</div>
<div class="line"><a name="l04388"></a><span class="lineno"> 4388</span>&#160;                }</div>
<div class="line"><a name="l04389"></a><span class="lineno"> 4389</span>&#160;            }</div>
<div class="line"><a name="l04390"></a><span class="lineno"> 4390</span>&#160; </div>
<div class="line"><a name="l04391"></a><span class="lineno"> 4391</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04392"></a><span class="lineno"> 4392</span>&#160;<span class="comment">             * See if this thing matches our filter.</span></div>
<div class="line"><a name="l04393"></a><span class="lineno"> 4393</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04394"></a><span class="lineno"> 4394</span>&#160;            <span class="keywordflow">if</span> (!CheckMsgFilter(message, msgMinFilter, msgMaxFilter) ||</div>
<div class="line"><a name="l04395"></a><span class="lineno"> 4395</span>&#160;                    !<a class="code" href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a>(pwnd, pwndFilter)) {</div>
<div class="line"><a name="l04396"></a><span class="lineno"> 4396</span>&#160;                <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(2);</div>
<div class="line"><a name="l04397"></a><span class="lineno"> 4397</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l04398"></a><span class="lineno"> 4398</span>&#160;            }</div>
<div class="line"><a name="l04399"></a><span class="lineno"> 4399</span>&#160; </div>
<div class="line"><a name="l04400"></a><span class="lineno"> 4400</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04401"></a><span class="lineno"> 4401</span>&#160;<span class="comment">             * This message matches our filter. If it is not for us then</span></div>
<div class="line"><a name="l04402"></a><span class="lineno"> 4402</span>&#160;<span class="comment">             * stop searching to make sure the real owner processes this</span></div>
<div class="line"><a name="l04403"></a><span class="lineno"> 4403</span>&#160;<span class="comment">             * message first.</span></div>
<div class="line"><a name="l04404"></a><span class="lineno"> 4404</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04405"></a><span class="lineno"> 4405</span>&#160;            <span class="keywordflow">if</span> (fOtherApp) {</div>
<div class="line"><a name="l04406"></a><span class="lineno"> 4406</span>&#160;                <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(4);</div>
<div class="line"><a name="l04407"></a><span class="lineno"> 4407</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l04408"></a><span class="lineno"> 4408</span>&#160;            }</div>
<div class="line"><a name="l04409"></a><span class="lineno"> 4409</span>&#160; </div>
<div class="line"><a name="l04410"></a><span class="lineno"> 4410</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04411"></a><span class="lineno"> 4411</span>&#160;<span class="comment">             * Generate some special messages if we are removing and we are</span></div>
<div class="line"><a name="l04412"></a><span class="lineno"> 4412</span>&#160;<span class="comment">             * not inside the menu loop.</span></div>
<div class="line"><a name="l04413"></a><span class="lineno"> 4413</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04414"></a><span class="lineno"> 4414</span>&#160;            <span class="keywordflow">if</span> (fRemove &amp;&amp; !<a class="code" href="a00899.html#af22598950c2f41d596373168bd1e15ef">IsInsideMenuLoop</a>(ptiCurrent)) {</div>
<div class="line"><a name="l04415"></a><span class="lineno"> 4415</span>&#160; </div>
<div class="line"><a name="l04416"></a><span class="lineno"> 4416</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04417"></a><span class="lineno"> 4417</span>&#160;<span class="comment">                 * Generate a WM_CONTEXTMENU for the VK_APPS key</span></div>
<div class="line"><a name="l04418"></a><span class="lineno"> 4418</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04419"></a><span class="lineno"> 4419</span>&#160;                <span class="keywordflow">if</span> ((wParam == VK_APPS) &amp;&amp; (message == WM_KEYUP)) {</div>
<div class="line"><a name="l04420"></a><span class="lineno"> 4420</span>&#160;                    <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(pwnd, WM_CONTEXTMENU, (WPARAM)PtoH(pwnd), -1);</div>
<div class="line"><a name="l04421"></a><span class="lineno"> 4421</span>&#160;                }</div>
<div class="line"><a name="l04422"></a><span class="lineno"> 4422</span>&#160; </div>
<div class="line"><a name="l04423"></a><span class="lineno"> 4423</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04424"></a><span class="lineno"> 4424</span>&#160;<span class="comment">                 * If this is a WM_KEYDOWN message for F1 key then we must generate</span></div>
<div class="line"><a name="l04425"></a><span class="lineno"> 4425</span>&#160;<span class="comment">                 * the WM_KEYF1 message.</span></div>
<div class="line"><a name="l04426"></a><span class="lineno"> 4426</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04427"></a><span class="lineno"> 4427</span>&#160;                <span class="keywordflow">if</span> ((wParam == VK_F1) &amp;&amp; (message == WM_KEYDOWN)) {</div>
<div class="line"><a name="l04428"></a><span class="lineno"> 4428</span>&#160;                    <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(pwnd, WM_KEYF1, 0, 0);</div>
<div class="line"><a name="l04429"></a><span class="lineno"> 4429</span>&#160;                }</div>
<div class="line"><a name="l04430"></a><span class="lineno"> 4430</span>&#160;            }</div>
<div class="line"><a name="l04431"></a><span class="lineno"> 4431</span>&#160; </div>
<div class="line"><a name="l04432"></a><span class="lineno"> 4432</span>&#160; </div>
<div class="line"><a name="l04433"></a><span class="lineno"> 4433</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04434"></a><span class="lineno"> 4434</span>&#160;<span class="comment">             * If one Shift key is released while the other Shift key is held</span></div>
<div class="line"><a name="l04435"></a><span class="lineno"> 4435</span>&#160;<span class="comment">             * down, this keystroke is normally skipped, presumably to prevent</span></div>
<div class="line"><a name="l04436"></a><span class="lineno"> 4436</span>&#160;<span class="comment">             * applications from thinking that the shift condition no longer</span></div>
<div class="line"><a name="l04437"></a><span class="lineno"> 4437</span>&#160;<span class="comment">             * applies.</span></div>
<div class="line"><a name="l04438"></a><span class="lineno"> 4438</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04439"></a><span class="lineno"> 4439</span>&#160;            <span class="keywordflow">if</span> (wParam == VK_SHIFT) {</div>
<div class="line"><a name="l04440"></a><span class="lineno"> 4440</span>&#160;                BYTE vkHanded, vkOtherHand;</div>
<div class="line"><a name="l04441"></a><span class="lineno"> 4441</span>&#160; </div>
<div class="line"><a name="l04442"></a><span class="lineno"> 4442</span>&#160;                <span class="keywordflow">if</span> (qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam &amp; <a class="code" href="a00347.html#aa8286b6273fa173b26ea440fde99d8c9">EXTENDED_BIT</a>) {</div>
<div class="line"><a name="l04443"></a><span class="lineno"> 4443</span>&#160;                    vkHanded = VK_RSHIFT;</div>
<div class="line"><a name="l04444"></a><span class="lineno"> 4444</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04445"></a><span class="lineno"> 4445</span>&#160;                    vkHanded = VK_LSHIFT;</div>
<div class="line"><a name="l04446"></a><span class="lineno"> 4446</span>&#160;                }</div>
<div class="line"><a name="l04447"></a><span class="lineno"> 4447</span>&#160;                vkOtherHand = vkHanded ^ 1;</div>
<div class="line"><a name="l04448"></a><span class="lineno"> 4448</span>&#160; </div>
<div class="line"><a name="l04449"></a><span class="lineno"> 4449</span>&#160;                <span class="keywordflow">if</span> (!fDown &amp;&amp; TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, vkOtherHand)) {</div>
<div class="line"><a name="l04450"></a><span class="lineno"> 4450</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04451"></a><span class="lineno"> 4451</span>&#160;<span class="comment">                     * Unlike normal apps, Console MUST be sent a Shift break</span></div>
<div class="line"><a name="l04452"></a><span class="lineno"> 4452</span>&#160;<span class="comment">                     * even when the other Shift key is still down, since it</span></div>
<div class="line"><a name="l04453"></a><span class="lineno"> 4453</span>&#160;<span class="comment">                     * has to be passed on to VDM, which maintains it&#39;s own</span></div>
<div class="line"><a name="l04454"></a><span class="lineno"> 4454</span>&#160;<span class="comment">                     * state. Check TIF_CSRSSTHREAD for the console input</span></div>
<div class="line"><a name="l04455"></a><span class="lineno"> 4455</span>&#160;<span class="comment">                     * thread because it lives in the server. This is a cheap</span></div>
<div class="line"><a name="l04456"></a><span class="lineno"> 4456</span>&#160;<span class="comment">                     * way to check for it.</span></div>
<div class="line"><a name="l04457"></a><span class="lineno"> 4457</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04458"></a><span class="lineno"> 4458</span>&#160;                    <span class="keywordflow">if</span> ((ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_CSRSSTHREAD) == 0) {</div>
<div class="line"><a name="l04459"></a><span class="lineno"> 4459</span>&#160;                        <span class="comment">/*</span></div>
<div class="line"><a name="l04460"></a><span class="lineno"> 4460</span>&#160;<span class="comment">                         * We ignore this key event, so we must update</span></div>
<div class="line"><a name="l04461"></a><span class="lineno"> 4461</span>&#160;<span class="comment">                         * it&#39;s key state whether fRemove is TRUE or not.</span></div>
<div class="line"><a name="l04462"></a><span class="lineno"> 4462</span>&#160;<span class="comment">                         * (ignoring an key event is same as removing it)</span></div>
<div class="line"><a name="l04463"></a><span class="lineno"> 4463</span>&#160;<span class="comment">                         */</span></div>
<div class="line"><a name="l04464"></a><span class="lineno"> 4464</span>&#160;                        qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam = vkHanded;</div>
<div class="line"><a name="l04465"></a><span class="lineno"> 4465</span>&#160;                        <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l04466"></a><span class="lineno"> 4466</span>&#160;                        <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(8);</div>
<div class="line"><a name="l04467"></a><span class="lineno"> 4467</span>&#160;                        <span class="keywordflow">goto</span> RestartScan;</div>
<div class="line"><a name="l04468"></a><span class="lineno"> 4468</span>&#160;                    }</div>
<div class="line"><a name="l04469"></a><span class="lineno"> 4469</span>&#160;                    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x10);</div>
<div class="line"><a name="l04470"></a><span class="lineno"> 4470</span>&#160;                }</div>
<div class="line"><a name="l04471"></a><span class="lineno"> 4471</span>&#160;            }</div>
<div class="line"><a name="l04472"></a><span class="lineno"> 4472</span>&#160; </div>
<div class="line"><a name="l04473"></a><span class="lineno"> 4473</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04474"></a><span class="lineno"> 4474</span>&#160;<span class="comment">             * Get the previous up/down state of the key here since</span></div>
<div class="line"><a name="l04475"></a><span class="lineno"> 4475</span>&#160;<span class="comment">             * SkipSysMsg() sets the key state table and destroys</span></div>
<div class="line"><a name="l04476"></a><span class="lineno"> 4476</span>&#160;<span class="comment">             * the previous state info.</span></div>
<div class="line"><a name="l04477"></a><span class="lineno"> 4477</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04478"></a><span class="lineno"> 4478</span>&#160;            fPrevDown = FALSE;</div>
<div class="line"><a name="l04479"></a><span class="lineno"> 4479</span>&#160;            <span class="keywordflow">if</span> (TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, wParam))</div>
<div class="line"><a name="l04480"></a><span class="lineno"> 4480</span>&#160;                fPrevDown = TRUE;</div>
<div class="line"><a name="l04481"></a><span class="lineno"> 4481</span>&#160; </div>
<div class="line"><a name="l04482"></a><span class="lineno"> 4482</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04483"></a><span class="lineno"> 4483</span>&#160;<span class="comment">             * Eat the message from the input queue and set the keystate</span></div>
<div class="line"><a name="l04484"></a><span class="lineno"> 4484</span>&#160;<span class="comment">             * table.</span></div>
<div class="line"><a name="l04485"></a><span class="lineno"> 4485</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04486"></a><span class="lineno"> 4486</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x20);</div>
<div class="line"><a name="l04487"></a><span class="lineno"> 4487</span>&#160;            <span class="keywordflow">if</span> (fRemove) {</div>
<div class="line"><a name="l04488"></a><span class="lineno"> 4488</span>&#160;                <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l04489"></a><span class="lineno"> 4489</span>&#160;            }</div>
<div class="line"><a name="l04490"></a><span class="lineno"> 4490</span>&#160; </div>
<div class="line"><a name="l04491"></a><span class="lineno"> 4491</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04492"></a><span class="lineno"> 4492</span>&#160;<span class="comment">             * This gets us the LOWORD of lParam, the repeat count,</span></div>
<div class="line"><a name="l04493"></a><span class="lineno"> 4493</span>&#160;<span class="comment">             * the bit in the hi byte indicating whether this is an extended</span></div>
<div class="line"><a name="l04494"></a><span class="lineno"> 4494</span>&#160;<span class="comment">             * key, and the scan code.  We also need to re-get the wParam in</span></div>
<div class="line"><a name="l04495"></a><span class="lineno"> 4495</span>&#160;<span class="comment">             * case xxxSkipSysMsg called a hook which modified the message.</span></div>
<div class="line"><a name="l04496"></a><span class="lineno"> 4496</span>&#160;<span class="comment">             * AfterDark&#39;s password protection does this.</span></div>
<div class="line"><a name="l04497"></a><span class="lineno"> 4497</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04498"></a><span class="lineno"> 4498</span>&#160;            lParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam;</div>
<div class="line"><a name="l04499"></a><span class="lineno"> 4499</span>&#160;            wParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam;</div>
<div class="line"><a name="l04500"></a><span class="lineno"> 4500</span>&#160; </div>
<div class="line"><a name="l04501"></a><span class="lineno"> 4501</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04502"></a><span class="lineno"> 4502</span>&#160;<span class="comment">             * Indicate if it was previously down.</span></div>
<div class="line"><a name="l04503"></a><span class="lineno"> 4503</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04504"></a><span class="lineno"> 4504</span>&#160;            <span class="keywordflow">if</span> (fPrevDown)</div>
<div class="line"><a name="l04505"></a><span class="lineno"> 4505</span>&#160;                lParam |= 0x40000000;           <span class="comment">// KF_REPEAT</span></div>
<div class="line"><a name="l04506"></a><span class="lineno"> 4506</span>&#160; </div>
<div class="line"><a name="l04507"></a><span class="lineno"> 4507</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04508"></a><span class="lineno"> 4508</span>&#160;<span class="comment">             * Set the transition bit.</span></div>
<div class="line"><a name="l04509"></a><span class="lineno"> 4509</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04510"></a><span class="lineno"> 4510</span>&#160;            <span class="keywordflow">switch</span> (message) {</div>
<div class="line"><a name="l04511"></a><span class="lineno"> 4511</span>&#160;            <span class="keywordflow">case</span> WM_KEYUP:</div>
<div class="line"><a name="l04512"></a><span class="lineno"> 4512</span>&#160;            <span class="keywordflow">case</span> WM_SYSKEYUP:</div>
<div class="line"><a name="l04513"></a><span class="lineno"> 4513</span>&#160;                lParam |= 0x80000000;           <span class="comment">// KF_UP</span></div>
<div class="line"><a name="l04514"></a><span class="lineno"> 4514</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04515"></a><span class="lineno"> 4515</span>&#160;            }</div>
<div class="line"><a name="l04516"></a><span class="lineno"> 4516</span>&#160; </div>
<div class="line"><a name="l04517"></a><span class="lineno"> 4517</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04518"></a><span class="lineno"> 4518</span>&#160;<span class="comment">             * Set the alt key down bit.</span></div>
<div class="line"><a name="l04519"></a><span class="lineno"> 4519</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04520"></a><span class="lineno"> 4520</span>&#160;            <span class="keywordflow">if</span> (TestKeyStateDown(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, VK_MENU)) {</div>
<div class="line"><a name="l04521"></a><span class="lineno"> 4521</span>&#160;                lParam |= 0x20000000;           <span class="comment">// KF_ALTDOWN</span></div>
<div class="line"><a name="l04522"></a><span class="lineno"> 4522</span>&#160;            }</div>
<div class="line"><a name="l04523"></a><span class="lineno"> 4523</span>&#160; </div>
<div class="line"><a name="l04524"></a><span class="lineno"> 4524</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04525"></a><span class="lineno"> 4525</span>&#160;<span class="comment">             * Set the menu state flag.</span></div>
<div class="line"><a name="l04526"></a><span class="lineno"> 4526</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04527"></a><span class="lineno"> 4527</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a00899.html#af1b5f58e67f1282eed05c0c519866f7c">IsMenuStarted</a>(ptiCurrent)) {</div>
<div class="line"><a name="l04528"></a><span class="lineno"> 4528</span>&#160;                lParam |= 0x10000000;           <span class="comment">// KF_MENUMODE</span></div>
<div class="line"><a name="l04529"></a><span class="lineno"> 4529</span>&#160;            }</div>
<div class="line"><a name="l04530"></a><span class="lineno"> 4530</span>&#160; </div>
<div class="line"><a name="l04531"></a><span class="lineno"> 4531</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04532"></a><span class="lineno"> 4532</span>&#160;<span class="comment">             * Set the dialog state flag.</span></div>
<div class="line"><a name="l04533"></a><span class="lineno"> 4533</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04534"></a><span class="lineno"> 4534</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; QF_DIALOGACTIVE) {</div>
<div class="line"><a name="l04535"></a><span class="lineno"> 4535</span>&#160;                lParam |= 0x08000000;           <span class="comment">// KF_DLGMODE</span></div>
<div class="line"><a name="l04536"></a><span class="lineno"> 4536</span>&#160;            }</div>
<div class="line"><a name="l04537"></a><span class="lineno"> 4537</span>&#160; </div>
<div class="line"><a name="l04538"></a><span class="lineno"> 4538</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04539"></a><span class="lineno"> 4539</span>&#160;<span class="comment">             * 0x80000000 is set if up, clear if down</span></div>
<div class="line"><a name="l04540"></a><span class="lineno"> 4540</span>&#160;<span class="comment">             * 0x40000000 is previous up/down state of key</span></div>
<div class="line"><a name="l04541"></a><span class="lineno"> 4541</span>&#160;<span class="comment">             * 0x20000000 is whether the alt key is down</span></div>
<div class="line"><a name="l04542"></a><span class="lineno"> 4542</span>&#160;<span class="comment">             * 0x10000000 is whether currently in menumode.</span></div>
<div class="line"><a name="l04543"></a><span class="lineno"> 4543</span>&#160;<span class="comment">             * 0x08000000 is whether in dialog mode</span></div>
<div class="line"><a name="l04544"></a><span class="lineno"> 4544</span>&#160;<span class="comment">             * 0x04000000 is not used</span></div>
<div class="line"><a name="l04545"></a><span class="lineno"> 4545</span>&#160;<span class="comment">             * 0x02000000 is not used</span></div>
<div class="line"><a name="l04546"></a><span class="lineno"> 4546</span>&#160;<span class="comment">             * 0x01000000 is whether this is an extended keyboard key</span></div>
<div class="line"><a name="l04547"></a><span class="lineno"> 4547</span>&#160;<span class="comment">             *</span></div>
<div class="line"><a name="l04548"></a><span class="lineno"> 4548</span>&#160;<span class="comment">             * Low word is repeat count, low byte hiword is scan code,</span></div>
<div class="line"><a name="l04549"></a><span class="lineno"> 4549</span>&#160;<span class="comment">             * hi byte hiword is all these bits.</span></div>
<div class="line"><a name="l04550"></a><span class="lineno"> 4550</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04551"></a><span class="lineno"> 4551</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l04552"></a><span class="lineno"> 4552</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04553"></a><span class="lineno"> 4553</span>&#160;<span class="comment">             * Callback the client IME before calling the keyboard hook.</span></div>
<div class="line"><a name="l04554"></a><span class="lineno"> 4554</span>&#160;<span class="comment">             * If the vkey is one of the IME hotkeys, the vkey will not</span></div>
<div class="line"><a name="l04555"></a><span class="lineno"> 4555</span>&#160;<span class="comment">             * be passed to the keyboard hook.</span></div>
<div class="line"><a name="l04556"></a><span class="lineno"> 4556</span>&#160;<span class="comment">             * If IME needs this vkey, VK_PROCESSKEY will be put into the</span></div>
<div class="line"><a name="l04557"></a><span class="lineno"> 4557</span>&#160;<span class="comment">             * application queue instead of real vkey.</span></div>
<div class="line"><a name="l04558"></a><span class="lineno"> 4558</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04559"></a><span class="lineno"> 4559</span>&#160;            <span class="keywordflow">if</span> ( fRemove &amp;&amp;</div>
<div class="line"><a name="l04560"></a><span class="lineno"> 4560</span>&#160;                 ! <a class="code" href="a00899.html#af1b5f58e67f1282eed05c0c519866f7c">IsMenuStarted</a>(ptiCurrent) &amp;&amp;</div>
<div class="line"><a name="l04561"></a><span class="lineno"> 4561</span>&#160;                 ! (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DISABLEIME) &amp;&amp;</div>
<div class="line"><a name="l04562"></a><span class="lineno"> 4562</span>&#160;                 ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a> != NULL</div>
<div class="line"><a name="l04563"></a><span class="lineno"> 4563</span>&#160;               )</div>
<div class="line"><a name="l04564"></a><span class="lineno"> 4564</span>&#160;            {</div>
<div class="line"><a name="l04565"></a><span class="lineno"> 4565</span>&#160;                dwImmRet = <a class="code" href="a00899.html#aa30d021e5e9cd423102a8ff2b7087f89">xxxImmProcessKey</a>( ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>,</div>
<div class="line"><a name="l04566"></a><span class="lineno"> 4566</span>&#160;                                             ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>,</div>
<div class="line"><a name="l04567"></a><span class="lineno"> 4567</span>&#160;                                             message,</div>
<div class="line"><a name="l04568"></a><span class="lineno"> 4568</span>&#160;                                             wParam,</div>
<div class="line"><a name="l04569"></a><span class="lineno"> 4569</span>&#160;                                             lParam);</div>
<div class="line"><a name="l04570"></a><span class="lineno"> 4570</span>&#160;                <span class="keywordflow">if</span> ( dwImmRet &amp; IPHK_HOTKEY ) {</div>
<div class="line"><a name="l04571"></a><span class="lineno"> 4571</span>&#160;                    dwImmRet = 0;</div>
<div class="line"><a name="l04572"></a><span class="lineno"> 4572</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04573"></a><span class="lineno"> 4573</span>&#160;                }</div>
<div class="line"><a name="l04574"></a><span class="lineno"> 4574</span>&#160;            }</div>
<div class="line"><a name="l04575"></a><span class="lineno"> 4575</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l04576"></a><span class="lineno"> 4576</span>&#160; </div>
<div class="line"><a name="l04577"></a><span class="lineno"> 4577</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04578"></a><span class="lineno"> 4578</span>&#160;<span class="comment">             * If we are removing the message, call the keyboard hook</span></div>
<div class="line"><a name="l04579"></a><span class="lineno"> 4579</span>&#160;<span class="comment">             * with HC_ACTION, otherwise call the hook with HC_NOREM</span></div>
<div class="line"><a name="l04580"></a><span class="lineno"> 4580</span>&#160;<span class="comment">             * to let it know that the message is not being removed.</span></div>
<div class="line"><a name="l04581"></a><span class="lineno"> 4581</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04582"></a><span class="lineno"> 4582</span>&#160;            <span class="keywordflow">if</span> (IsHooked(ptiCurrent, WHF_KEYBOARD)) {</div>
<div class="line"><a name="l04583"></a><span class="lineno"> 4583</span>&#160;                fKbdHookCalled = TRUE;</div>
<div class="line"><a name="l04584"></a><span class="lineno"> 4584</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(fRemove ? HC_ACTION : HC_NOREMOVE,</div>
<div class="line"><a name="l04585"></a><span class="lineno"> 4585</span>&#160;                        wParam, lParam, WH_KEYBOARD)) {</div>
<div class="line"><a name="l04586"></a><span class="lineno"> 4586</span>&#160;                    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x40);</div>
<div class="line"><a name="l04587"></a><span class="lineno"> 4587</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04588"></a><span class="lineno"> 4588</span>&#160;                }</div>
<div class="line"><a name="l04589"></a><span class="lineno"> 4589</span>&#160;            }</div>
<div class="line"><a name="l04590"></a><span class="lineno"> 4590</span>&#160; </div>
<div class="line"><a name="l04591"></a><span class="lineno"> 4591</span>&#160;            <span class="keywordflow">if</span> (fKbdHookCalled &amp;&amp; fRemove &amp;&amp; IsHooked(ptiCurrent, WHF_CBT)) {</div>
<div class="line"><a name="l04592"></a><span class="lineno"> 4592</span>&#160;                <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HCBT_KEYSKIPPED, wParam, lParam, WH_CBT);</div>
<div class="line"><a name="l04593"></a><span class="lineno"> 4593</span>&#160;                <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x80);</div>
<div class="line"><a name="l04594"></a><span class="lineno"> 4594</span>&#160;            }</div>
<div class="line"><a name="l04595"></a><span class="lineno"> 4595</span>&#160; </div>
<div class="line"><a name="l04596"></a><span class="lineno"> 4596</span>&#160;            fKbdHookCalled = FALSE;</div>
<div class="line"><a name="l04597"></a><span class="lineno"> 4597</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x100);</div>
<div class="line"><a name="l04598"></a><span class="lineno"> 4598</span>&#160;            <span class="keywordflow">goto</span> ReturnMessage;</div>
<div class="line"><a name="l04599"></a><span class="lineno"> 4599</span>&#160; </div>
<div class="line"><a name="l04600"></a><span class="lineno"> 4600</span>&#160;        <span class="keywordflow">case</span> WM_MOUSEWHEEL:</div>
<div class="line"><a name="l04601"></a><span class="lineno"> 4601</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04602"></a><span class="lineno"> 4602</span>&#160;<span class="comment">             * If we are sending keyboard input to an app that has been</span></div>
<div class="line"><a name="l04603"></a><span class="lineno"> 4603</span>&#160;<span class="comment">             * spinning then boost it back up.  If we don&#39;t you use spinning</span></div>
<div class="line"><a name="l04604"></a><span class="lineno"> 4604</span>&#160;<span class="comment">             * apps like Write or Project and do two builds in the</span></div>
<div class="line"><a name="l04605"></a><span class="lineno"> 4605</span>&#160;<span class="comment">             * background.  Note the app will also be unboosted again shortly</span></div>
<div class="line"><a name="l04606"></a><span class="lineno"> 4606</span>&#160;<span class="comment">             * after you stop typing by the old logic. #11188</span></div>
<div class="line"><a name="l04607"></a><span class="lineno"> 4607</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04608"></a><span class="lineno"> 4608</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING)</div>
<div class="line"><a name="l04609"></a><span class="lineno"> 4609</span>&#160;                <a class="code" href="a03290.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(ptiCurrent);</div>
<div class="line"><a name="l04610"></a><span class="lineno"> 4610</span>&#160; </div>
<div class="line"><a name="l04611"></a><span class="lineno"> 4611</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04612"></a><span class="lineno"> 4612</span>&#160;<span class="comment">             * Assign the input to the focus window. If there is no focus</span></div>
<div class="line"><a name="l04613"></a><span class="lineno"> 4613</span>&#160;<span class="comment">             * window, or we are in a menu loop, eat this message.</span></div>
<div class="line"><a name="l04614"></a><span class="lineno"> 4614</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04615"></a><span class="lineno"> 4615</span>&#160;            pwnd = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>;</div>
<div class="line"><a name="l04616"></a><span class="lineno"> 4616</span>&#160;            <span class="keywordflow">if</span> (pwnd == NULL || <a class="code" href="a00899.html#af22598950c2f41d596373168bd1e15ef">IsInsideMenuLoop</a>(ptiCurrent)) {</div>
<div class="line"><a name="l04617"></a><span class="lineno"> 4617</span>&#160;                <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x20000000);</div>
<div class="line"><a name="l04618"></a><span class="lineno"> 4618</span>&#160;                <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04619"></a><span class="lineno"> 4619</span>&#160;            }</div>
<div class="line"><a name="l04620"></a><span class="lineno"> 4620</span>&#160; </div>
<div class="line"><a name="l04621"></a><span class="lineno"> 4621</span>&#160;            ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l04622"></a><span class="lineno"> 4622</span>&#160;            ThreadLockAlwaysWithPti(ptiCurrent, pwnd, &amp;tlpwnd);</div>
<div class="line"><a name="l04623"></a><span class="lineno"> 4623</span>&#160; </div>
<div class="line"><a name="l04624"></a><span class="lineno"> 4624</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04625"></a><span class="lineno"> 4625</span>&#160;<span class="comment">             * Check if this is intended for the current app.</span></div>
<div class="line"><a name="l04626"></a><span class="lineno"> 4626</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04627"></a><span class="lineno"> 4627</span>&#160;            <span class="keywordflow">if</span> (fOtherApp = (GETPTI(pwnd) != ptiCurrent)) {</div>
<div class="line"><a name="l04628"></a><span class="lineno"> 4628</span>&#160; </div>
<div class="line"><a name="l04629"></a><span class="lineno"> 4629</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04630"></a><span class="lineno"> 4630</span>&#160;<span class="comment">                 * If this other app isn&#39;t going to read from this</span></div>
<div class="line"><a name="l04631"></a><span class="lineno"> 4631</span>&#160;<span class="comment">                 * queue, then skip this message. This can happen if</span></div>
<div class="line"><a name="l04632"></a><span class="lineno"> 4632</span>&#160;<span class="comment">                 * the RIT queues up a message thinking it goes to</span></div>
<div class="line"><a name="l04633"></a><span class="lineno"> 4633</span>&#160;<span class="comment">                 * a particular hwnd, but then by the time GetMessage()</span></div>
<div class="line"><a name="l04634"></a><span class="lineno"> 4634</span>&#160;<span class="comment">                 * is called for that thread, it doesn&#39;t go to that hwnd</span></div>
<div class="line"><a name="l04635"></a><span class="lineno"> 4635</span>&#160;<span class="comment">                 * (like in the case of mouse messages, window rearrangement</span></div>
<div class="line"><a name="l04636"></a><span class="lineno"> 4636</span>&#160;<span class="comment">                 * happens which changes which hwnd the mouse hits on).</span></div>
<div class="line"><a name="l04637"></a><span class="lineno"> 4637</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04638"></a><span class="lineno"> 4638</span>&#160;                <span class="keywordflow">if</span> (GETPTI(pwnd)-&gt;pq != ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) {</div>
<div class="line"><a name="l04639"></a><span class="lineno"> 4639</span>&#160;                    <a class="code" href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a>(0x40000000);</div>
<div class="line"><a name="l04640"></a><span class="lineno"> 4640</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04641"></a><span class="lineno"> 4641</span>&#160;                }</div>
<div class="line"><a name="l04642"></a><span class="lineno"> 4642</span>&#160; </div>
<div class="line"><a name="l04643"></a><span class="lineno"> 4643</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04644"></a><span class="lineno"> 4644</span>&#160;<span class="comment">                 * If not for us, then remember who it is for.</span></div>
<div class="line"><a name="l04645"></a><span class="lineno"> 4645</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04646"></a><span class="lineno"> 4646</span>&#160;                <span class="keywordflow">if</span> (ptiKeyWake == NULL) {</div>
<div class="line"><a name="l04647"></a><span class="lineno"> 4647</span>&#160;                    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(1);</div>
<div class="line"><a name="l04648"></a><span class="lineno"> 4648</span>&#160;                    ptiKeyWake = GETPTI(pwnd);</div>
<div class="line"><a name="l04649"></a><span class="lineno"> 4649</span>&#160;                }</div>
<div class="line"><a name="l04650"></a><span class="lineno"> 4650</span>&#160;            }</div>
<div class="line"><a name="l04651"></a><span class="lineno"> 4651</span>&#160; </div>
<div class="line"><a name="l04652"></a><span class="lineno"> 4652</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04653"></a><span class="lineno"> 4653</span>&#160;<span class="comment">             * See if this thing matches our filter.</span></div>
<div class="line"><a name="l04654"></a><span class="lineno"> 4654</span>&#160;<span class="comment">             * NOTE: We need to check whether the caller is filtering</span></div>
<div class="line"><a name="l04655"></a><span class="lineno"> 4655</span>&#160;<span class="comment">             * for all mouse messages - if so, we assume the caller</span></div>
<div class="line"><a name="l04656"></a><span class="lineno"> 4656</span>&#160;<span class="comment">             * wants mouse wheel messages too.</span></div>
<div class="line"><a name="l04657"></a><span class="lineno"> 4657</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04658"></a><span class="lineno"> 4658</span>&#160;            <span class="keywordflow">if</span> (    !CheckMsgFilter(WM_MOUSEWHEEL, msgMinFilter, msgMaxFilter) ||</div>
<div class="line"><a name="l04659"></a><span class="lineno"> 4659</span>&#160;                    !<a class="code" href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a>(pwnd, pwndFilter)) {</div>
<div class="line"><a name="l04660"></a><span class="lineno"> 4660</span>&#160;                <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(2);</div>
<div class="line"><a name="l04661"></a><span class="lineno"> 4661</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l04662"></a><span class="lineno"> 4662</span>&#160;            }</div>
<div class="line"><a name="l04663"></a><span class="lineno"> 4663</span>&#160; </div>
<div class="line"><a name="l04664"></a><span class="lineno"> 4664</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04665"></a><span class="lineno"> 4665</span>&#160;<span class="comment">             * This message matches our filter. If it is not for us then</span></div>
<div class="line"><a name="l04666"></a><span class="lineno"> 4666</span>&#160;<span class="comment">             * stop searching to make sure the real owner processes this</span></div>
<div class="line"><a name="l04667"></a><span class="lineno"> 4667</span>&#160;<span class="comment">             * message first.</span></div>
<div class="line"><a name="l04668"></a><span class="lineno"> 4668</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04669"></a><span class="lineno"> 4669</span>&#160;            <span class="keywordflow">if</span> (fOtherApp) {</div>
<div class="line"><a name="l04670"></a><span class="lineno"> 4670</span>&#160;                <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(4);</div>
<div class="line"><a name="l04671"></a><span class="lineno"> 4671</span>&#160;                <span class="keywordflow">goto</span> NoMessages;</div>
<div class="line"><a name="l04672"></a><span class="lineno"> 4672</span>&#160;            }</div>
<div class="line"><a name="l04673"></a><span class="lineno"> 4673</span>&#160; </div>
<div class="line"><a name="l04674"></a><span class="lineno"> 4674</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04675"></a><span class="lineno"> 4675</span>&#160;<span class="comment">             * Eat the message from the input queue and set the keystate</span></div>
<div class="line"><a name="l04676"></a><span class="lineno"> 4676</span>&#160;<span class="comment">             * table.</span></div>
<div class="line"><a name="l04677"></a><span class="lineno"> 4677</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04678"></a><span class="lineno"> 4678</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x20);</div>
<div class="line"><a name="l04679"></a><span class="lineno"> 4679</span>&#160;            <span class="keywordflow">if</span> (fRemove) {</div>
<div class="line"><a name="l04680"></a><span class="lineno"> 4680</span>&#160;                <a class="code" href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a>(ptiCurrent, &amp;qmsg);</div>
<div class="line"><a name="l04681"></a><span class="lineno"> 4681</span>&#160;            }</div>
<div class="line"><a name="l04682"></a><span class="lineno"> 4682</span>&#160; </div>
<div class="line"><a name="l04683"></a><span class="lineno"> 4683</span>&#160;            wParam = <a class="code" href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb">GetMouseKeyFlags</a>(ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>);</div>
<div class="line"><a name="l04684"></a><span class="lineno"> 4684</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(LOWORD(qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam) == 0);</div>
<div class="line"><a name="l04685"></a><span class="lineno"> 4685</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(HIWORD(wParam) == 0);</div>
<div class="line"><a name="l04686"></a><span class="lineno"> 4686</span>&#160;            wParam |= qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam;</div>
<div class="line"><a name="l04687"></a><span class="lineno"> 4687</span>&#160;            lParam = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam;</div>
<div class="line"><a name="l04688"></a><span class="lineno"> 4688</span>&#160; </div>
<div class="line"><a name="l04689"></a><span class="lineno"> 4689</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04690"></a><span class="lineno"> 4690</span>&#160;<span class="comment">             * If we are removing the message, call the mouse hook</span></div>
<div class="line"><a name="l04691"></a><span class="lineno"> 4691</span>&#160;<span class="comment">             * with HC_ACTION, otherwise call the hook with HC_NOREM</span></div>
<div class="line"><a name="l04692"></a><span class="lineno"> 4692</span>&#160;<span class="comment">             * to let it know that the message is not being removed.</span></div>
<div class="line"><a name="l04693"></a><span class="lineno"> 4693</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04694"></a><span class="lineno"> 4694</span>&#160;            <span class="keywordflow">if</span> (IsHooked(ptiCurrent, WHF_MOUSE)) {</div>
<div class="line"><a name="l04695"></a><span class="lineno"> 4695</span>&#160;                fMouseHookCalled = TRUE;</div>
<div class="line"><a name="l04696"></a><span class="lineno"> 4696</span>&#160;                mhs.pt = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt;</div>
<div class="line"><a name="l04697"></a><span class="lineno"> 4697</span>&#160;                mhs.hwnd = HW(pwnd);</div>
<div class="line"><a name="l04698"></a><span class="lineno"> 4698</span>&#160;                mhs.wHitTestCode = HTNOWHERE;</div>
<div class="line"><a name="l04699"></a><span class="lineno"> 4699</span>&#160;                mhs.dwExtraInfo = qmsg.<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>;</div>
<div class="line"><a name="l04700"></a><span class="lineno"> 4700</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="a00701.html#a3f27401daee77aa63faa3ff562de7207">xxxCallMouseHook</a>(message, &amp;mhs, fRemove)) {</div>
<div class="line"><a name="l04701"></a><span class="lineno"> 4701</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04702"></a><span class="lineno"> 4702</span>&#160;<span class="comment">                     * Not allowed by mouse hook; so skip it.</span></div>
<div class="line"><a name="l04703"></a><span class="lineno"> 4703</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04704"></a><span class="lineno"> 4704</span>&#160;                    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x40);</div>
<div class="line"><a name="l04705"></a><span class="lineno"> 4705</span>&#160;                    <span class="keywordflow">goto</span> SkipMessage;</div>
<div class="line"><a name="l04706"></a><span class="lineno"> 4706</span>&#160;                }</div>
<div class="line"><a name="l04707"></a><span class="lineno"> 4707</span>&#160;            }</div>
<div class="line"><a name="l04708"></a><span class="lineno"> 4708</span>&#160; </div>
<div class="line"><a name="l04709"></a><span class="lineno"> 4709</span>&#160;            <span class="keywordflow">if</span> (fMouseHookCalled &amp;&amp; fRemove &amp;&amp; IsHooked(ptiCurrent, WHF_CBT)) {</div>
<div class="line"><a name="l04710"></a><span class="lineno"> 4710</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04711"></a><span class="lineno"> 4711</span>&#160;<span class="comment">                 * CONSIDER: Add new HCBT_ constant for the mouse wheel?</span></div>
<div class="line"><a name="l04712"></a><span class="lineno"> 4712</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04713"></a><span class="lineno"> 4713</span>&#160;                <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HCBT_CLICKSKIPPED, message, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>) &amp;mhs, WH_CBT);</div>
<div class="line"><a name="l04714"></a><span class="lineno"> 4714</span>&#160;                <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x80);</div>
<div class="line"><a name="l04715"></a><span class="lineno"> 4715</span>&#160;            }</div>
<div class="line"><a name="l04716"></a><span class="lineno"> 4716</span>&#160; </div>
<div class="line"><a name="l04717"></a><span class="lineno"> 4717</span>&#160;            fMouseHookCalled = FALSE;</div>
<div class="line"><a name="l04718"></a><span class="lineno"> 4718</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x100);</div>
<div class="line"><a name="l04719"></a><span class="lineno"> 4719</span>&#160;            <span class="keywordflow">goto</span> ReturnMessage;</div>
<div class="line"><a name="l04720"></a><span class="lineno"> 4720</span>&#160;        } <span class="comment">/* End of switch (message = qmsg.msg.message) */</span></div>
<div class="line"><a name="l04721"></a><span class="lineno"> 4721</span>&#160;    } <span class="comment">/* End of the GetNextSysMsg() loop */</span></div>
<div class="line"><a name="l04722"></a><span class="lineno"> 4722</span>&#160; </div>
<div class="line"><a name="l04723"></a><span class="lineno"> 4723</span>&#160;ReturnMessage:</div>
<div class="line"><a name="l04724"></a><span class="lineno"> 4724</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a82665c77f0395ea674ade3c7a96bd9d1">ptLast</a> = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt;</div>
<div class="line"><a name="l04725"></a><span class="lineno"> 4725</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a63f9a7301bdb8da51c5180336650f449">timeLast</a> = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time;</div>
<div class="line"><a name="l04726"></a><span class="lineno"> 4726</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a> = qmsg.<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>;</div>
<div class="line"><a name="l04727"></a><span class="lineno"> 4727</span>&#160; </div>
<div class="line"><a name="l04728"></a><span class="lineno"> 4728</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04729"></a><span class="lineno"> 4729</span>&#160;<span class="comment">     * idSysLock value of 1 indicates that the message came from the input</span></div>
<div class="line"><a name="l04730"></a><span class="lineno"> 4730</span>&#160;<span class="comment">     * queue.</span></div>
<div class="line"><a name="l04731"></a><span class="lineno"> 4731</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04732"></a><span class="lineno"> 4732</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a908f89e143de49ad52495f21d8231d8a">idLast</a> = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a271f3bdd84cb32ef7ab8c919d19ae658">idSysLock</a> = 1;</div>
<div class="line"><a name="l04733"></a><span class="lineno"> 4733</span>&#160; </div>
<div class="line"><a name="l04734"></a><span class="lineno"> 4734</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04735"></a><span class="lineno"> 4735</span>&#160;<span class="comment">     * Now see if our input bit is set for this input. If it isn&#39;t, set ours</span></div>
<div class="line"><a name="l04736"></a><span class="lineno"> 4736</span>&#160;<span class="comment">     * and clear the guy who had it previously.</span></div>
<div class="line"><a name="l04737"></a><span class="lineno"> 4737</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04738"></a><span class="lineno"> 4738</span>&#160;    <a class="code" href="a00824.html#a700c756867e191fed7d258edd7e3e536">TransferWakeBit</a>(ptiCurrent, message);</div>
<div class="line"><a name="l04739"></a><span class="lineno"> 4739</span>&#160; </div>
<div class="line"><a name="l04740"></a><span class="lineno"> 4740</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04741"></a><span class="lineno"> 4741</span>&#160;<span class="comment">     * Clear the input bits if no messages in the input queue.</span></div>
<div class="line"><a name="l04742"></a><span class="lineno"> 4742</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04743"></a><span class="lineno"> 4743</span>&#160;    <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_MOUSE | QS_KEY | QS_EVENT | QS_TRANSFER, TRUE);</div>
<div class="line"><a name="l04744"></a><span class="lineno"> 4744</span>&#160; </div>
<div class="line"><a name="l04745"></a><span class="lineno"> 4745</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04746"></a><span class="lineno"> 4746</span>&#160;<span class="comment">     * Get the message and split.</span></div>
<div class="line"><a name="l04747"></a><span class="lineno"> 4747</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04748"></a><span class="lineno"> 4748</span>&#160;    lpMsg-&gt;hwnd = HW(pwnd);</div>
<div class="line"><a name="l04749"></a><span class="lineno"> 4749</span>&#160;    lpMsg-&gt;message = message;</div>
<div class="line"><a name="l04750"></a><span class="lineno"> 4750</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l04751"></a><span class="lineno"> 4751</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04752"></a><span class="lineno"> 4752</span>&#160;<span class="comment">     * If the IME claims that it needs this vkey, replace it</span></div>
<div class="line"><a name="l04753"></a><span class="lineno"> 4753</span>&#160;<span class="comment">     * with VK_PROCESSKEY. The real vkey has been saved in</span></div>
<div class="line"><a name="l04754"></a><span class="lineno"> 4754</span>&#160;<span class="comment">     * the input context in the client side.</span></div>
<div class="line"><a name="l04755"></a><span class="lineno"> 4755</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04756"></a><span class="lineno"> 4756</span>&#160;    lpMsg-&gt;wParam = ( dwImmRet &amp; IPHK_PROCESSBYIME ) ? VK_PROCESSKEY : wParam;</div>
<div class="line"><a name="l04757"></a><span class="lineno"> 4757</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l04758"></a><span class="lineno"> 4758</span>&#160;    lpMsg-&gt;wParam = wParam;</div>
<div class="line"><a name="l04759"></a><span class="lineno"> 4759</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l04760"></a><span class="lineno"> 4760</span>&#160;    lpMsg-&gt;lParam = lParam;</div>
<div class="line"><a name="l04761"></a><span class="lineno"> 4761</span>&#160;    lpMsg-&gt;time = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time;</div>
<div class="line"><a name="l04762"></a><span class="lineno"> 4762</span>&#160;    lpMsg-&gt;pt = qmsg.<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt;</div>
<div class="line"><a name="l04763"></a><span class="lineno"> 4763</span>&#160; </div>
<div class="line"><a name="l04764"></a><span class="lineno"> 4764</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l04765"></a><span class="lineno"> 4765</span>&#160;    <span class="keywordflow">if</span> (gfLogPlayback &amp;&amp; ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> == (<span class="keywordtype">int</span>)<a class="code" href="a03290.html#a9c2a89c84dc8211a1e69f10e5a271ddd">PQMSG_PLAYBACK</a>)</div>
<div class="line"><a name="l04766"></a><span class="lineno"> 4766</span>&#160;        LogPlayback(pwnd, lpMsg);</div>
<div class="line"><a name="l04767"></a><span class="lineno"> 4767</span>&#160;<span class="preprocessor">#endif  // DBG</span></div>
<div class="line"><a name="l04768"></a><span class="lineno"> 4768</span>&#160; </div>
<div class="line"><a name="l04769"></a><span class="lineno"> 4769</span>&#160;    ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l04770"></a><span class="lineno"> 4770</span>&#160; </div>
<div class="line"><a name="l04771"></a><span class="lineno"> 4771</span>&#160;    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x200);</div>
<div class="line"><a name="l04772"></a><span class="lineno"> 4772</span>&#160;    <a class="code" href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a>();</div>
<div class="line"><a name="l04773"></a><span class="lineno"> 4773</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l04774"></a><span class="lineno"> 4774</span>&#160; </div>
<div class="line"><a name="l04775"></a><span class="lineno"> 4775</span>&#160;NoMessages:</div>
<div class="line"><a name="l04776"></a><span class="lineno"> 4776</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04777"></a><span class="lineno"> 4777</span>&#160;<span class="comment">     * The message was for another app, or none were found that fit the</span></div>
<div class="line"><a name="l04778"></a><span class="lineno"> 4778</span>&#160;<span class="comment">     * filter.</span></div>
<div class="line"><a name="l04779"></a><span class="lineno"> 4779</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04780"></a><span class="lineno"> 4780</span>&#160; </div>
<div class="line"><a name="l04781"></a><span class="lineno"> 4781</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04782"></a><span class="lineno"> 4782</span>&#160;<span class="comment">     * Unlock the system queue.</span></div>
<div class="line"><a name="l04783"></a><span class="lineno"> 4783</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04784"></a><span class="lineno"> 4784</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a271f3bdd84cb32ef7ab8c919d19ae658">idSysLock</a>  = 0;</div>
<div class="line"><a name="l04785"></a><span class="lineno"> 4785</span>&#160;    <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(4, ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, NULL);</div>
<div class="line"><a name="l04786"></a><span class="lineno"> 4786</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = NULL;</div>
<div class="line"><a name="l04787"></a><span class="lineno"> 4787</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a51167c8ff7f1cc33e44ee9777e1016c9">CTIF_flags</a> &amp;= ~CTIF_SYSQUEUELOCKED;</div>
<div class="line"><a name="l04788"></a><span class="lineno"> 4788</span>&#160; </div>
<div class="line"><a name="l04789"></a><span class="lineno"> 4789</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04790"></a><span class="lineno"> 4790</span>&#160;<span class="comment">     * Wake up someone else if we found a message for him.  QS_TRANSFER</span></div>
<div class="line"><a name="l04791"></a><span class="lineno"> 4791</span>&#160;<span class="comment">     * signifies that the thread was woken due to input transfer</span></div>
<div class="line"><a name="l04792"></a><span class="lineno"> 4792</span>&#160;<span class="comment">     * from another thread, rather than from a real input event.</span></div>
<div class="line"><a name="l04793"></a><span class="lineno"> 4793</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04794"></a><span class="lineno"> 4794</span>&#160;    <span class="keywordflow">if</span> (ptiKeyWake != NULL || ptiMouseWake != NULL || ptiEventWake != NULL) {</div>
<div class="line"><a name="l04795"></a><span class="lineno"> 4795</span>&#160;        <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x400);</div>
<div class="line"><a name="l04796"></a><span class="lineno"> 4796</span>&#160;        <span class="keywordflow">if</span> (ptiKeyWake != NULL) {</div>
<div class="line"><a name="l04797"></a><span class="lineno"> 4797</span>&#160;            <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiKeyWake, QS_KEY | QS_TRANSFER);</div>
<div class="line"><a name="l04798"></a><span class="lineno"> 4798</span>&#160;            <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_KEY | QS_TRANSFER, FALSE);</div>
<div class="line"><a name="l04799"></a><span class="lineno"> 4799</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x800);</div>
<div class="line"><a name="l04800"></a><span class="lineno"> 4800</span>&#160;        }</div>
<div class="line"><a name="l04801"></a><span class="lineno"> 4801</span>&#160; </div>
<div class="line"><a name="l04802"></a><span class="lineno"> 4802</span>&#160;        <span class="keywordflow">if</span> (ptiMouseWake != NULL) {</div>
<div class="line"><a name="l04803"></a><span class="lineno"> 4803</span>&#160;            <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiMouseWake, QS_MOUSE | QS_TRANSFER);</div>
<div class="line"><a name="l04804"></a><span class="lineno"> 4804</span>&#160;            <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_MOUSE | QS_TRANSFER, FALSE);</div>
<div class="line"><a name="l04805"></a><span class="lineno"> 4805</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x1000);</div>
<div class="line"><a name="l04806"></a><span class="lineno"> 4806</span>&#160;        }</div>
<div class="line"><a name="l04807"></a><span class="lineno"> 4807</span>&#160; </div>
<div class="line"><a name="l04808"></a><span class="lineno"> 4808</span>&#160;        <span class="keywordflow">if</span> (ptiEventWake != NULL) {</div>
<div class="line"><a name="l04809"></a><span class="lineno"> 4809</span>&#160;            <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiEventWake, QS_EVENTSET);</div>
<div class="line"><a name="l04810"></a><span class="lineno"> 4810</span>&#160;            <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_EVENT, FALSE);</div>
<div class="line"><a name="l04811"></a><span class="lineno"> 4811</span>&#160;            <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x2000);</div>
<div class="line"><a name="l04812"></a><span class="lineno"> 4812</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (FJOURNALPLAYBACK()) {</div>
<div class="line"><a name="l04813"></a><span class="lineno"> 4813</span>&#160; </div>
<div class="line"><a name="l04814"></a><span class="lineno"> 4814</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04815"></a><span class="lineno"> 4815</span>&#160;<span class="comment">             * If journal playback is occuring, clear the input bits.  This will</span></div>
<div class="line"><a name="l04816"></a><span class="lineno"> 4816</span>&#160;<span class="comment">             * help prevent a race condition between two threads that call</span></div>
<div class="line"><a name="l04817"></a><span class="lineno"> 4817</span>&#160;<span class="comment">             * WaitMessage/PeekMessage.  This can occur when embedding an OLE</span></div>
<div class="line"><a name="l04818"></a><span class="lineno"> 4818</span>&#160;<span class="comment">             * object.  An example is inserting a Word object into an Excel</span></div>
<div class="line"><a name="l04819"></a><span class="lineno"> 4819</span>&#160;<span class="comment">             * spreadsheet.</span></div>
<div class="line"><a name="l04820"></a><span class="lineno"> 4820</span>&#160;<span class="comment">             * Also clear change bits else this thread might not xxxSleepThread.</span></div>
<div class="line"><a name="l04821"></a><span class="lineno"> 4821</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04822"></a><span class="lineno"> 4822</span>&#160;            ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#ad7384d5f6cca06e0d245aaa350ba6e22">fsWakeBitsJournal</a> |= (ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp;</div>
<div class="line"><a name="l04823"></a><span class="lineno"> 4823</span>&#160;                    (QS_MOUSE | QS_KEY | QS_TRANSFER));</div>
<div class="line"><a name="l04824"></a><span class="lineno"> 4824</span>&#160;            <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_MOUSE | QS_KEY | QS_TRANSFER, FALSE);</div>
<div class="line"><a name="l04825"></a><span class="lineno"> 4825</span>&#160;            ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp;= ~(QS_MOUSE | QS_KEY | QS_TRANSFER);</div>
<div class="line"><a name="l04826"></a><span class="lineno"> 4826</span>&#160;        }</div>
<div class="line"><a name="l04827"></a><span class="lineno"> 4827</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04828"></a><span class="lineno"> 4828</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04829"></a><span class="lineno"> 4829</span>&#160;<span class="comment">         * Clear the input bits if no messages in the input queue.</span></div>
<div class="line"><a name="l04830"></a><span class="lineno"> 4830</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04831"></a><span class="lineno"> 4831</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#ad7384d5f6cca06e0d245aaa350ba6e22">fsWakeBitsJournal</a> = 0;</div>
<div class="line"><a name="l04832"></a><span class="lineno"> 4832</span>&#160;        <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(ptiCurrent, QS_MOUSE | QS_KEY | QS_EVENT |</div>
<div class="line"><a name="l04833"></a><span class="lineno"> 4833</span>&#160;                QS_TRANSFER, TRUE);</div>
<div class="line"><a name="l04834"></a><span class="lineno"> 4834</span>&#160;        <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x4000);</div>
<div class="line"><a name="l04835"></a><span class="lineno"> 4835</span>&#160;    }</div>
<div class="line"><a name="l04836"></a><span class="lineno"> 4836</span>&#160; </div>
<div class="line"><a name="l04837"></a><span class="lineno"> 4837</span>&#160;    ThreadUnlock(&amp;tlpwnd);</div>
<div class="line"><a name="l04838"></a><span class="lineno"> 4838</span>&#160; </div>
<div class="line"><a name="l04839"></a><span class="lineno"> 4839</span>&#160;    <a class="code" href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a>(0x8000);</div>
<div class="line"><a name="l04840"></a><span class="lineno"> 4840</span>&#160;    <a class="code" href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a>();</div>
<div class="line"><a name="l04841"></a><span class="lineno"> 4841</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l04842"></a><span class="lineno"> 4842</span>&#160;}</div>
<div class="line"><a name="l04843"></a><span class="lineno"> 4843</span>&#160;<span class="preprocessor">#undef PATHTAKEN</span></div>
<div class="line"><a name="l04844"></a><span class="lineno"> 4844</span>&#160;<span class="preprocessor">#undef PATHTAKEN2</span></div>
<div class="line"><a name="l04845"></a><span class="lineno"> 4845</span>&#160;<span class="preprocessor">#undef PATHTAKEN3</span></div>
<div class="line"><a name="l04846"></a><span class="lineno"> 4846</span>&#160;<span class="preprocessor">#undef DUMPPATHTAKEN</span></div>
<div class="line"><a name="l04847"></a><span class="lineno"> 4847</span>&#160;<span class="preprocessor">#undef DUMPSUBPATHTAKEN</span></div>
<div class="line"><a name="l04848"></a><span class="lineno"> 4848</span>&#160; </div>
<div class="line"><a name="l04849"></a><span class="lineno"> 4849</span>&#160; </div>
<div class="line"><a name="l04859"></a><span class="lineno"><a class="line" href="a00899.html#aa6ce87df873d5f9f1383eac7a3a8267d"> 4859</a></span>&#160;VOID <a class="code" href="a03290.html#aa6ce87df873d5f9f1383eac7a3a8267d">IdleTimerProc</a>(VOID)</div>
<div class="line"><a name="l04860"></a><span class="lineno"> 4860</span>&#160;{</div>
<div class="line"><a name="l04861"></a><span class="lineno"> 4861</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l04862"></a><span class="lineno"> 4862</span>&#160; </div>
<div class="line"><a name="l04863"></a><span class="lineno"> 4863</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00731.html#a5a3f95ba0694746c5099aa1846b335c5">_GetAsyncKeyState</a>(VK_LBUTTON) &amp; 0x8000)</div>
<div class="line"><a name="l04864"></a><span class="lineno"> 4864</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l04865"></a><span class="lineno"> 4865</span>&#160; </div>
<div class="line"><a name="l04866"></a><span class="lineno"> 4866</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00731.html#a5a3f95ba0694746c5099aa1846b335c5">_GetAsyncKeyState</a>(VK_RBUTTON) &amp; 0x8000)</div>
<div class="line"><a name="l04867"></a><span class="lineno"> 4867</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l04868"></a><span class="lineno"> 4868</span>&#160; </div>
<div class="line"><a name="l04869"></a><span class="lineno"> 4869</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00731.html#a5a3f95ba0694746c5099aa1846b335c5">_GetAsyncKeyState</a>(VK_MBUTTON) &amp; 0x8000)</div>
<div class="line"><a name="l04870"></a><span class="lineno"> 4870</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l04871"></a><span class="lineno"> 4871</span>&#160; </div>
<div class="line"><a name="l04872"></a><span class="lineno"> 4872</span>&#160;    <span class="keywordflow">if</span> ((<a class="code" href="a03257.html#a190de89de30966bef80ba543dcfaf812">iScreenSaveTimeOut</a> &gt; 0) &amp;&amp; (<a class="code" href="a03257.html#a606776c14d11ee58302343e63e1cb890">timeLastInputMessage</a> != 0)) {</div>
<div class="line"><a name="l04873"></a><span class="lineno"> 4873</span>&#160; </div>
<div class="line"><a name="l04874"></a><span class="lineno"> 4874</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04875"></a><span class="lineno"> 4875</span>&#160;<span class="comment">         * Should we screen save?</span></div>
<div class="line"><a name="l04876"></a><span class="lineno"> 4876</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04877"></a><span class="lineno"> 4877</span>&#160;        <span class="keywordflow">if</span> ((NtGetTickCount() - <a class="code" href="a03257.html#a606776c14d11ee58302343e63e1cb890">timeLastInputMessage</a>) &gt;</div>
<div class="line"><a name="l04878"></a><span class="lineno"> 4878</span>&#160;                (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)(<a class="code" href="a03257.html#a190de89de30966bef80ba543dcfaf812">iScreenSaveTimeOut</a> * 1000)) {</div>
<div class="line"><a name="l04879"></a><span class="lineno"> 4879</span>&#160; </div>
<div class="line"><a name="l04880"></a><span class="lineno"> 4880</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04881"></a><span class="lineno"> 4881</span>&#160;<span class="comment">             * Set this to 0 so that we don&#39;t try to screen save again till</span></div>
<div class="line"><a name="l04882"></a><span class="lineno"> 4882</span>&#160;<span class="comment">             * we get another input message.</span></div>
<div class="line"><a name="l04883"></a><span class="lineno"> 4883</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04884"></a><span class="lineno"> 4884</span>&#160;            <a class="code" href="a03257.html#a606776c14d11ee58302343e63e1cb890">timeLastInputMessage</a> = 0;</div>
<div class="line"><a name="l04885"></a><span class="lineno"> 4885</span>&#160; </div>
<div class="line"><a name="l04886"></a><span class="lineno"> 4886</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> != NULL &amp;&amp; <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> != NULL) {</div>
<div class="line"><a name="l04887"></a><span class="lineno"> 4887</span>&#160;                <a class="code" href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a>(<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>,</div>
<div class="line"><a name="l04888"></a><span class="lineno"> 4888</span>&#160;                        WM_SYSCOMMAND, SC_SCREENSAVE, 0L);</div>
<div class="line"><a name="l04889"></a><span class="lineno"> 4889</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04890"></a><span class="lineno"> 4890</span>&#160;                <a class="code" href="a00875.html#a71623c9cb9e2b5c70fbb4235c6bb4b53">StartScreenSaver</a>();</div>
<div class="line"><a name="l04891"></a><span class="lineno"> 4891</span>&#160;            }</div>
<div class="line"><a name="l04892"></a><span class="lineno"> 4892</span>&#160;        }</div>
<div class="line"><a name="l04893"></a><span class="lineno"> 4893</span>&#160;    }</div>
<div class="line"><a name="l04894"></a><span class="lineno"> 4894</span>&#160;}</div>
<div class="line"><a name="l04895"></a><span class="lineno"> 4895</span>&#160; </div>
<div class="line"><a name="l04896"></a><span class="lineno"> 4896</span>&#160; </div>
<div class="line"><a name="l04904"></a><span class="lineno"><a class="line" href="a00899.html#a1c01d2a4698ae083619ac8dcd3e97daa"> 4904</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(</div>
<div class="line"><a name="l04905"></a><span class="lineno"> 4905</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l04906"></a><span class="lineno"> 4906</span>&#160;{</div>
<div class="line"><a name="l04907"></a><span class="lineno"> 4907</span>&#160;    PW32PROCESS W32Process = W32GetCurrentProcess();</div>
<div class="line"><a name="l04908"></a><span class="lineno"> 4908</span>&#160; </div>
<div class="line"><a name="l04909"></a><span class="lineno"> 4909</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04910"></a><span class="lineno"> 4910</span>&#160;<span class="comment">     * clear out the TIF_FIRSTIDLE since here we are</span></div>
<div class="line"><a name="l04911"></a><span class="lineno"> 4911</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04912"></a><span class="lineno"> 4912</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp;= ~TIF_FIRSTIDLE;</div>
<div class="line"><a name="l04913"></a><span class="lineno"> 4913</span>&#160; </div>
<div class="line"><a name="l04914"></a><span class="lineno"> 4914</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04915"></a><span class="lineno"> 4915</span>&#160;<span class="comment">     * If this is a screen saver, set its priority - this will force it</span></div>
<div class="line"><a name="l04916"></a><span class="lineno"> 4916</span>&#160;<span class="comment">     * to go idle.</span></div>
<div class="line"><a name="l04917"></a><span class="lineno"> 4917</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04918"></a><span class="lineno"> 4918</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SCREENSAVER)</div>
<div class="line"><a name="l04919"></a><span class="lineno"> 4919</span>&#160;        <a class="code" href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a>(pti, FALSE);</div>
<div class="line"><a name="l04920"></a><span class="lineno"> 4920</span>&#160; </div>
<div class="line"><a name="l04921"></a><span class="lineno"> 4921</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04922"></a><span class="lineno"> 4922</span>&#160;<span class="comment">     * Shared Wow Apps use the per thread idle event for synchronization.</span></div>
<div class="line"><a name="l04923"></a><span class="lineno"> 4923</span>&#160;<span class="comment">     * Separate Wow VDMs use the regular mechanism.</span></div>
<div class="line"><a name="l04924"></a><span class="lineno"> 4924</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04925"></a><span class="lineno"> 4925</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SHAREDWOW) {</div>
<div class="line"><a name="l04926"></a><span class="lineno"> 4926</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT);</div>
<div class="line"><a name="l04927"></a><span class="lineno"> 4927</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">pwti</a>) {</div>
<div class="line"><a name="l04928"></a><span class="lineno"> 4928</span>&#160;            SET_PSEUDO_EVENT(&amp;pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">pwti</a>-&gt;<a class="code" href="a02877.html#afb9b6a62420feb835630dae9263ba014">pIdleEvent</a>);</div>
<div class="line"><a name="l04929"></a><span class="lineno"> 4929</span>&#160;        }</div>
<div class="line"><a name="l04930"></a><span class="lineno"> 4930</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04931"></a><span class="lineno"> 4931</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04932"></a><span class="lineno"> 4932</span>&#160;<span class="comment">         * If the main thread is NULL, set it to this queue: it is calling</span></div>
<div class="line"><a name="l04933"></a><span class="lineno"> 4933</span>&#160;<span class="comment">         * GetMessage().</span></div>
<div class="line"><a name="l04934"></a><span class="lineno"> 4934</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04935"></a><span class="lineno"> 4935</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> == NULL)</div>
<div class="line"><a name="l04936"></a><span class="lineno"> 4936</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> = pti;</div>
<div class="line"><a name="l04937"></a><span class="lineno"> 4937</span>&#160; </div>
<div class="line"><a name="l04938"></a><span class="lineno"> 4938</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04939"></a><span class="lineno"> 4939</span>&#160;<span class="comment">         * Wake up anyone waiting on this event.</span></div>
<div class="line"><a name="l04940"></a><span class="lineno"> 4940</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04941"></a><span class="lineno"> 4941</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> == pti) {</div>
<div class="line"><a name="l04942"></a><span class="lineno"> 4942</span>&#160;            SET_PSEUDO_EVENT(&amp;W32Process-&gt;InputIdleEvent);</div>
<div class="line"><a name="l04943"></a><span class="lineno"> 4943</span>&#160;        }</div>
<div class="line"><a name="l04944"></a><span class="lineno"> 4944</span>&#160;    }</div>
<div class="line"><a name="l04945"></a><span class="lineno"> 4945</span>&#160; </div>
<div class="line"><a name="l04946"></a><span class="lineno"> 4946</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04947"></a><span class="lineno"> 4947</span>&#160;<span class="comment">     * Check to see if the startglass is on, and if so turn it off and update.</span></div>
<div class="line"><a name="l04948"></a><span class="lineno"> 4948</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04949"></a><span class="lineno"> 4949</span>&#160;    <span class="keywordflow">if</span> (W32Process-&gt;W32PF_Flags &amp; W32PF_STARTGLASS) {</div>
<div class="line"><a name="l04950"></a><span class="lineno"> 4950</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04951"></a><span class="lineno"> 4951</span>&#160;<span class="comment">         * This app is no longer in &quot;starting&quot; mode. Recalc when to hide</span></div>
<div class="line"><a name="l04952"></a><span class="lineno"> 4952</span>&#160;<span class="comment">         * the app starting cursor.</span></div>
<div class="line"><a name="l04953"></a><span class="lineno"> 4953</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04954"></a><span class="lineno"> 4954</span>&#160;        W32Process-&gt;W32PF_Flags &amp;= ~W32PF_STARTGLASS;</div>
<div class="line"><a name="l04955"></a><span class="lineno"> 4955</span>&#160;        <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(NULL, 0);</div>
<div class="line"><a name="l04956"></a><span class="lineno"> 4956</span>&#160;    }</div>
<div class="line"><a name="l04957"></a><span class="lineno"> 4957</span>&#160;}</div>
<div class="line"><a name="l04958"></a><span class="lineno"> 4958</span>&#160; </div>
<div class="line"><a name="l04959"></a><span class="lineno"><a class="line" href="a00899.html#a8f4abbaf01183de33a1a46d034cd37a1"> 4959</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a51ccaa0d03e99d3be71c4ac54a262154">SleepInputIdle</a>(</div>
<div class="line"><a name="l04960"></a><span class="lineno"> 4960</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l04961"></a><span class="lineno"> 4961</span>&#160;{</div>
<div class="line"><a name="l04962"></a><span class="lineno"> 4962</span>&#160;    PW32PROCESS W32Process;</div>
<div class="line"><a name="l04963"></a><span class="lineno"> 4963</span>&#160; </div>
<div class="line"><a name="l04964"></a><span class="lineno"> 4964</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04965"></a><span class="lineno"> 4965</span>&#160;<span class="comment">     * Shared Wow Apps use the per thread idle event for synchronization.</span></div>
<div class="line"><a name="l04966"></a><span class="lineno"> 4966</span>&#160;<span class="comment">     * Separate Wow VDMs use the regular mechanism.</span></div>
<div class="line"><a name="l04967"></a><span class="lineno"> 4967</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04968"></a><span class="lineno"> 4968</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SHAREDWOW) {</div>
<div class="line"><a name="l04969"></a><span class="lineno"> 4969</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT);</div>
<div class="line"><a name="l04970"></a><span class="lineno"> 4970</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">pwti</a>) {</div>
<div class="line"><a name="l04971"></a><span class="lineno"> 4971</span>&#160;            RESET_PSEUDO_EVENT(&amp;pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">pwti</a>-&gt;<a class="code" href="a02877.html#afb9b6a62420feb835630dae9263ba014">pIdleEvent</a>);</div>
<div class="line"><a name="l04972"></a><span class="lineno"> 4972</span>&#160;        }</div>
<div class="line"><a name="l04973"></a><span class="lineno"> 4973</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04974"></a><span class="lineno"> 4974</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04975"></a><span class="lineno"> 4975</span>&#160;<span class="comment">         * If the main thread is NULL, set it to this queue: it is calling</span></div>
<div class="line"><a name="l04976"></a><span class="lineno"> 4976</span>&#160;<span class="comment">         * GetMessage().</span></div>
<div class="line"><a name="l04977"></a><span class="lineno"> 4977</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04978"></a><span class="lineno"> 4978</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> == NULL)</div>
<div class="line"><a name="l04979"></a><span class="lineno"> 4979</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> = pti;</div>
<div class="line"><a name="l04980"></a><span class="lineno"> 4980</span>&#160; </div>
<div class="line"><a name="l04981"></a><span class="lineno"> 4981</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04982"></a><span class="lineno"> 4982</span>&#160;<span class="comment">         * Put to sleep up anyone waiting on this event.</span></div>
<div class="line"><a name="l04983"></a><span class="lineno"> 4983</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04984"></a><span class="lineno"> 4984</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> == pti) {</div>
<div class="line"><a name="l04985"></a><span class="lineno"> 4985</span>&#160;            W32Process = W32GetCurrentProcess();</div>
<div class="line"><a name="l04986"></a><span class="lineno"> 4986</span>&#160;            RESET_PSEUDO_EVENT(&amp;W32Process-&gt;InputIdleEvent);</div>
<div class="line"><a name="l04987"></a><span class="lineno"> 4987</span>&#160;        }</div>
<div class="line"><a name="l04988"></a><span class="lineno"> 4988</span>&#160;    }</div>
<div class="line"><a name="l04989"></a><span class="lineno"> 4989</span>&#160;}</div>
<div class="line"><a name="l04990"></a><span class="lineno"> 4990</span>&#160; </div>
<div class="line"><a name="l04991"></a><span class="lineno"> 4991</span>&#160; </div>
<div class="line"><a name="l05015"></a><span class="lineno"><a class="line" href="a03290.html#aa9bd51ab0c0075e158ae221347d12557"> 5015</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#aa9bd51ab0c0075e158ae221347d12557">AddAttachment</a>(</div>
<div class="line"><a name="l05016"></a><span class="lineno"> 5016</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l05017"></a><span class="lineno"> 5017</span>&#160;    <a class="code" href="a02869.html">PQ</a> pqAttach,</div>
<div class="line"><a name="l05018"></a><span class="lineno"> 5018</span>&#160;    LPBOOL pfChanged)</div>
<div class="line"><a name="l05019"></a><span class="lineno"> 5019</span>&#160;{</div>
<div class="line"><a name="l05020"></a><span class="lineno"> 5020</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> != pqAttach) {</div>
<div class="line"><a name="l05021"></a><span class="lineno"> 5021</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05022"></a><span class="lineno"> 5022</span>&#160;<span class="comment">         * LATER</span></div>
<div class="line"><a name="l05023"></a><span class="lineno"> 5023</span>&#160;<span class="comment">         * !!! This is totally screwed up,  The only reason that this thing</span></div>
<div class="line"><a name="l05024"></a><span class="lineno"> 5024</span>&#160;<span class="comment">         * could be non null is because two threads are going through</span></div>
<div class="line"><a name="l05025"></a><span class="lineno"> 5025</span>&#160;<span class="comment">         * attachthreadintput() at the same time.  No one can predict</span></div>
<div class="line"><a name="l05026"></a><span class="lineno"> 5026</span>&#160;<span class="comment">         * what kind of problems are going to be caused by that.</span></div>
<div class="line"><a name="l05027"></a><span class="lineno"> 5027</span>&#160;<span class="comment">         * We leave the critical section in one place where we send</span></div>
<div class="line"><a name="l05028"></a><span class="lineno"> 5028</span>&#160;<span class="comment">         * WM_CANCELMODE below.  We should figure out how to remove</span></div>
<div class="line"><a name="l05029"></a><span class="lineno"> 5029</span>&#160;<span class="comment">         * the sendmessage.</span></div>
<div class="line"><a name="l05030"></a><span class="lineno"> 5030</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l05031"></a><span class="lineno"> 5031</span>&#160;<span class="comment">         * If there already is a queue there, as there may be, destroy it.</span></div>
<div class="line"><a name="l05032"></a><span class="lineno"> 5032</span>&#160;<span class="comment">         * Note that DestroyQueue() will only get rid of the queue if the</span></div>
<div class="line"><a name="l05033"></a><span class="lineno"> 5033</span>&#160;<span class="comment">         * thread reference count goes to 0.</span></div>
<div class="line"><a name="l05034"></a><span class="lineno"> 5034</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05035"></a><span class="lineno"> 5035</span>&#160;        <a class="code" href="a02869.html">PQ</a> pqDestroy = pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>;</div>
<div class="line"><a name="l05036"></a><span class="lineno"> 5036</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> = pqAttach;</div>
<div class="line"><a name="l05037"></a><span class="lineno"> 5037</span>&#160;        <span class="keywordflow">if</span> (pqDestroy != NULL)</div>
<div class="line"><a name="l05038"></a><span class="lineno"> 5038</span>&#160;            <a class="code" href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a>(pqDestroy, pti);</div>
<div class="line"><a name="l05039"></a><span class="lineno"> 5039</span>&#160;        pqAttach-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>++;</div>
<div class="line"><a name="l05040"></a><span class="lineno"> 5040</span>&#160;        *pfChanged = TRUE;</div>
<div class="line"><a name="l05041"></a><span class="lineno"> 5041</span>&#160;    }</div>
<div class="line"><a name="l05042"></a><span class="lineno"> 5042</span>&#160;}</div>
<div class="line"><a name="l05043"></a><span class="lineno"> 5043</span>&#160; </div>
<div class="line"><a name="l05044"></a><span class="lineno"><a class="line" href="a03290.html#a35e4e68150e7c6714358e095e657bda6"> 5044</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a35e4e68150e7c6714358e095e657bda6">Recalc2</a>(</div>
<div class="line"><a name="l05045"></a><span class="lineno"> 5045</span>&#160;    <a class="code" href="a02869.html">PQ</a> pqAttach)</div>
<div class="line"><a name="l05046"></a><span class="lineno"> 5046</span>&#160;{</div>
<div class="line"><a name="l05047"></a><span class="lineno"> 5047</span>&#160;    <a class="code" href="a02873.html">PATTACHINFO</a> pai;</div>
<div class="line"><a name="l05048"></a><span class="lineno"> 5048</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l05049"></a><span class="lineno"> 5049</span>&#160;    BOOL fChanged;</div>
<div class="line"><a name="l05050"></a><span class="lineno"> 5050</span>&#160;    PLIST_ENTRY pHead, pEntry;</div>
<div class="line"><a name="l05051"></a><span class="lineno"> 5051</span>&#160; </div>
<div class="line"><a name="l05052"></a><span class="lineno"> 5052</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05053"></a><span class="lineno"> 5053</span>&#160;<span class="comment">     * Keep adding attachments until everything that should be attached to this</span></div>
<div class="line"><a name="l05054"></a><span class="lineno"> 5054</span>&#160;<span class="comment">     * queue is attached</span></div>
<div class="line"><a name="l05055"></a><span class="lineno"> 5055</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05056"></a><span class="lineno"> 5056</span>&#160;    <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l05057"></a><span class="lineno"> 5057</span>&#160;        fChanged = FALSE;</div>
<div class="line"><a name="l05058"></a><span class="lineno"> 5058</span>&#160; </div>
<div class="line"><a name="l05059"></a><span class="lineno"> 5059</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05060"></a><span class="lineno"> 5060</span>&#160;<span class="comment">         * If a thread is attached to this Q attach all of it&#39;s attachments</span></div>
<div class="line"><a name="l05061"></a><span class="lineno"> 5061</span>&#160;<span class="comment">         * and MWOW buddies if they aren&#39;t already attached.</span></div>
<div class="line"><a name="l05062"></a><span class="lineno"> 5062</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05063"></a><span class="lineno"> 5063</span>&#160;        pHead = &amp;<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">PtiList</a>;</div>
<div class="line"><a name="l05064"></a><span class="lineno"> 5064</span>&#160;        <span class="keywordflow">for</span> (pEntry = pHead-&gt;Flink; pEntry != pHead; pEntry = pEntry-&gt;Flink) {</div>
<div class="line"><a name="l05065"></a><span class="lineno"> 5065</span>&#160;            pti = CONTAINING_RECORD(pEntry, <a class="code" href="a02889.html">THREADINFO</a>, PtiLink);</div>
<div class="line"><a name="l05066"></a><span class="lineno"> 5066</span>&#160; </div>
<div class="line"><a name="l05067"></a><span class="lineno"> 5067</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> == pqAttach) {</div>
<div class="line"><a name="l05068"></a><span class="lineno"> 5068</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l05069"></a><span class="lineno"> 5069</span>&#160;<span class="comment">                 * check each of the attachments to see if this thread is attached</span></div>
<div class="line"><a name="l05070"></a><span class="lineno"> 5070</span>&#160;<span class="comment">                 * to any other threads</span></div>
<div class="line"><a name="l05071"></a><span class="lineno"> 5071</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l05072"></a><span class="lineno"> 5072</span>&#160;                <span class="keywordflow">for</span> (pai = <a class="code" href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a>; pai != NULL; pai = pai-&gt;<a class="code" href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">paiNext</a>) {</div>
<div class="line"><a name="l05073"></a><span class="lineno"> 5073</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l05074"></a><span class="lineno"> 5074</span>&#160;<span class="comment">                     * if they weren&#39;t attached already, attach them</span></div>
<div class="line"><a name="l05075"></a><span class="lineno"> 5075</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l05076"></a><span class="lineno"> 5076</span>&#160;                    <span class="keywordflow">if</span> (pai-&gt;<a class="code" href="a02873.html#a65c028a342cf68ac34f9334a0a35e98f">pti1</a> == pti || pai-&gt;<a class="code" href="a02873.html#a3c206203f1d50c21a63ae662ea9bdf48">pti2</a> == pti) {</div>
<div class="line"><a name="l05077"></a><span class="lineno"> 5077</span>&#160;                        <a class="code" href="a03290.html#aa9bd51ab0c0075e158ae221347d12557">AddAttachment</a>(</div>
<div class="line"><a name="l05078"></a><span class="lineno"> 5078</span>&#160;                                (pai-&gt;<a class="code" href="a02873.html#a65c028a342cf68ac34f9334a0a35e98f">pti1</a> == pti) ? pai-&gt;<a class="code" href="a02873.html#a3c206203f1d50c21a63ae662ea9bdf48">pti2</a> : pai-&gt;<a class="code" href="a02873.html#a65c028a342cf68ac34f9334a0a35e98f">pti1</a>,</div>
<div class="line"><a name="l05079"></a><span class="lineno"> 5079</span>&#160;                                pqAttach,</div>
<div class="line"><a name="l05080"></a><span class="lineno"> 5080</span>&#160;                                &amp;fChanged);</div>
<div class="line"><a name="l05081"></a><span class="lineno"> 5081</span>&#160;                    }</div>
<div class="line"><a name="l05082"></a><span class="lineno"> 5082</span>&#160;                }</div>
<div class="line"><a name="l05083"></a><span class="lineno"> 5083</span>&#160; </div>
<div class="line"><a name="l05084"></a><span class="lineno"> 5084</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l05085"></a><span class="lineno"> 5085</span>&#160;<span class="comment">                 * If this is a 16bit thread attach to all other threads in</span></div>
<div class="line"><a name="l05086"></a><span class="lineno"> 5086</span>&#160;<span class="comment">                 * it&#39;s MWOW</span></div>
<div class="line"><a name="l05087"></a><span class="lineno"> 5087</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l05088"></a><span class="lineno"> 5088</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l05089"></a><span class="lineno"> 5089</span>&#160;                    <a class="code" href="a02889.html">PTHREADINFO</a> ptiAttach;</div>
<div class="line"><a name="l05090"></a><span class="lineno"> 5090</span>&#160;                    PLIST_ENTRY pHeadAttach, pEntryAttach;</div>
<div class="line"><a name="l05091"></a><span class="lineno"> 5091</span>&#160; </div>
<div class="line"><a name="l05092"></a><span class="lineno"> 5092</span>&#160;                    pHeadAttach = &amp;pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">PtiList</a>;</div>
<div class="line"><a name="l05093"></a><span class="lineno"> 5093</span>&#160;                    <span class="keywordflow">for</span> (pEntryAttach = pHeadAttach-&gt;Flink;</div>
<div class="line"><a name="l05094"></a><span class="lineno"> 5094</span>&#160;                            pEntryAttach != pHeadAttach;</div>
<div class="line"><a name="l05095"></a><span class="lineno"> 5095</span>&#160;                            pEntryAttach = pEntryAttach-&gt;Flink) {</div>
<div class="line"><a name="l05096"></a><span class="lineno"> 5096</span>&#160;                        ptiAttach = CONTAINING_RECORD(pEntryAttach, <a class="code" href="a02889.html">THREADINFO</a>, PtiLink);</div>
<div class="line"><a name="l05097"></a><span class="lineno"> 5097</span>&#160; </div>
<div class="line"><a name="l05098"></a><span class="lineno"> 5098</span>&#160;                        <span class="keywordflow">if</span> (ptiAttach-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT &amp;&amp;</div>
<div class="line"><a name="l05099"></a><span class="lineno"> 5099</span>&#160;                            ptiAttach-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a> == pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>) {</div>
<div class="line"><a name="l05100"></a><span class="lineno"> 5100</span>&#160;                            <a class="code" href="a03290.html#aa9bd51ab0c0075e158ae221347d12557">AddAttachment</a>(ptiAttach, pqAttach, &amp;fChanged);</div>
<div class="line"><a name="l05101"></a><span class="lineno"> 5101</span>&#160;                        }</div>
<div class="line"><a name="l05102"></a><span class="lineno"> 5102</span>&#160;                    }</div>
<div class="line"><a name="l05103"></a><span class="lineno"> 5103</span>&#160;                }</div>
<div class="line"><a name="l05104"></a><span class="lineno"> 5104</span>&#160;            }</div>
<div class="line"><a name="l05105"></a><span class="lineno"> 5105</span>&#160;        }</div>
<div class="line"><a name="l05106"></a><span class="lineno"> 5106</span>&#160;    } <span class="keywordflow">while</span> (fChanged);</div>
<div class="line"><a name="l05107"></a><span class="lineno"> 5107</span>&#160;}</div>
<div class="line"><a name="l05108"></a><span class="lineno"> 5108</span>&#160; </div>
<div class="line"><a name="l05109"></a><span class="lineno"> 5109</span>&#160; </div>
<div class="line"><a name="l05110"></a><span class="lineno"><a class="line" href="a03290.html#a673f9d872c88727c8dd0c627382981f5"> 5110</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#a673f9d872c88727c8dd0c627382981f5">RecalcThreadAttachment</a>()</div>
<div class="line"><a name="l05111"></a><span class="lineno"> 5111</span>&#160;{</div>
<div class="line"><a name="l05112"></a><span class="lineno"> 5112</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l05113"></a><span class="lineno"> 5113</span>&#160;    PLIST_ENTRY pHead, pEntry;</div>
<div class="line"><a name="l05114"></a><span class="lineno"> 5114</span>&#160; </div>
<div class="line"><a name="l05115"></a><span class="lineno"> 5115</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05116"></a><span class="lineno"> 5116</span>&#160;<span class="comment">     * For all threads, start an attach queue if a thread hasn&#39;t been</span></div>
<div class="line"><a name="l05117"></a><span class="lineno"> 5117</span>&#160;<span class="comment">     * attached yet.</span></div>
<div class="line"><a name="l05118"></a><span class="lineno"> 5118</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05119"></a><span class="lineno"> 5119</span>&#160;    pHead = &amp;<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">PtiList</a>;</div>
<div class="line"><a name="l05120"></a><span class="lineno"> 5120</span>&#160;    <span class="keywordflow">for</span> (pEntry = pHead-&gt;Flink; pEntry != pHead; pEntry = pEntry-&gt;Flink) {</div>
<div class="line"><a name="l05121"></a><span class="lineno"> 5121</span>&#160;        pti = CONTAINING_RECORD(pEntry, <a class="code" href="a02889.html">THREADINFO</a>, PtiLink);</div>
<div class="line"><a name="l05122"></a><span class="lineno"> 5122</span>&#160; </div>
<div class="line"><a name="l05123"></a><span class="lineno"> 5123</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05124"></a><span class="lineno"> 5124</span>&#160;<span class="comment">         * If the thread does not have a queue yet, don&#39;t</span></div>
<div class="line"><a name="l05125"></a><span class="lineno"> 5125</span>&#160;<span class="comment">         * attach.</span></div>
<div class="line"><a name="l05126"></a><span class="lineno"> 5126</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05127"></a><span class="lineno"> 5127</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> == NULL) {</div>
<div class="line"><a name="l05128"></a><span class="lineno"> 5128</span>&#160; </div>
<div class="line"><a name="l05129"></a><span class="lineno"> 5129</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05130"></a><span class="lineno"> 5130</span>&#160;<span class="comment">             * Allocate a new queue for this thread if more than</span></div>
<div class="line"><a name="l05131"></a><span class="lineno"> 5131</span>&#160;<span class="comment">             * one thread references it.</span></div>
<div class="line"><a name="l05132"></a><span class="lineno"> 5132</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05133"></a><span class="lineno"> 5133</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> &gt; 1) {</div>
<div class="line"><a name="l05134"></a><span class="lineno"> 5134</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> = <a class="code" href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a>(NULL, NULL);</div>
<div class="line"><a name="l05135"></a><span class="lineno"> 5135</span>&#160; </div>
<div class="line"><a name="l05136"></a><span class="lineno"> 5136</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> == NULL) {</div>
<div class="line"><a name="l05137"></a><span class="lineno"> 5137</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05138"></a><span class="lineno"> 5138</span>&#160;                }</div>
<div class="line"><a name="l05139"></a><span class="lineno"> 5139</span>&#160; </div>
<div class="line"><a name="l05140"></a><span class="lineno"> 5140</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>++;</div>
<div class="line"><a name="l05141"></a><span class="lineno"> 5141</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05142"></a><span class="lineno"> 5142</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l05143"></a><span class="lineno"> 5143</span>&#160;            }</div>
<div class="line"><a name="l05144"></a><span class="lineno"> 5144</span>&#160; </div>
<div class="line"><a name="l05145"></a><span class="lineno"> 5145</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05146"></a><span class="lineno"> 5146</span>&#160;<span class="comment">             * Attach every thread that is directly or indirectly attached</span></div>
<div class="line"><a name="l05147"></a><span class="lineno"> 5147</span>&#160;<span class="comment">             * to this thread.</span></div>
<div class="line"><a name="l05148"></a><span class="lineno"> 5148</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05149"></a><span class="lineno"> 5149</span>&#160;            <a class="code" href="a03290.html#a35e4e68150e7c6714358e095e657bda6">Recalc2</a>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>);</div>
<div class="line"><a name="l05150"></a><span class="lineno"> 5150</span>&#160;        }</div>
<div class="line"><a name="l05151"></a><span class="lineno"> 5151</span>&#160;    }</div>
<div class="line"><a name="l05152"></a><span class="lineno"> 5152</span>&#160;}</div>
<div class="line"><a name="l05153"></a><span class="lineno"> 5153</span>&#160; </div>
<div class="line"><a name="l05154"></a><span class="lineno"> 5154</span>&#160; </div>
<div class="line"><a name="l05155"></a><span class="lineno"> 5155</span>&#160; </div>
<div class="line"><a name="l05165"></a><span class="lineno"><a class="line" href="a03290.html#aba92d10b804737271611397aecd11ac0"> 5165</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#aba92d10b804737271611397aecd11ac0">RedistributeInput</a>(</div>
<div class="line"><a name="l05166"></a><span class="lineno"> 5166</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgS,</div>
<div class="line"><a name="l05167"></a><span class="lineno"> 5167</span>&#160;    <a class="code" href="a02869.html">PQ</a>    pqRedist)</div>
<div class="line"><a name="l05168"></a><span class="lineno"> 5168</span>&#160;{</div>
<div class="line"><a name="l05169"></a><span class="lineno"> 5169</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiSave;</div>
<div class="line"><a name="l05170"></a><span class="lineno"> 5170</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l05171"></a><span class="lineno"> 5171</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> *ppqmsgD;</div>
<div class="line"><a name="l05172"></a><span class="lineno"> 5172</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgT;</div>
<div class="line"><a name="l05173"></a><span class="lineno"> 5173</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pmlInput;</div>
<div class="line"><a name="l05174"></a><span class="lineno"> 5174</span>&#160; </div>
<div class="line"><a name="l05175"></a><span class="lineno"> 5175</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05176"></a><span class="lineno"> 5176</span>&#160;<span class="comment">     * Since the thread attaching or unattaching may have left a queue</span></div>
<div class="line"><a name="l05177"></a><span class="lineno"> 5177</span>&#160;<span class="comment">     * shared by other threads, the messages we are going to requeue</span></div>
<div class="line"><a name="l05178"></a><span class="lineno"> 5178</span>&#160;<span class="comment">     * may have multiple destinations. On top of this, once we find</span></div>
<div class="line"><a name="l05179"></a><span class="lineno"> 5179</span>&#160;<span class="comment">     * a home queue for a message, it needs to be inserted in the</span></div>
<div class="line"><a name="l05180"></a><span class="lineno"> 5180</span>&#160;<span class="comment">     * list ordered by its time stamp (older messages go at the end).</span></div>
<div class="line"><a name="l05181"></a><span class="lineno"> 5181</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05182"></a><span class="lineno"> 5182</span>&#160; </div>
<div class="line"><a name="l05183"></a><span class="lineno"> 5183</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05184"></a><span class="lineno"> 5184</span>&#160;<span class="comment">     * Loop through a given dest&#39;s messages to find where to insert</span></div>
<div class="line"><a name="l05185"></a><span class="lineno"> 5185</span>&#160;<span class="comment">     * the source messages, based on message time stamp. Be sure</span></div>
<div class="line"><a name="l05186"></a><span class="lineno"> 5186</span>&#160;<span class="comment">     * to deal with empty message lists (meaning, check for NULL).</span></div>
<div class="line"><a name="l05187"></a><span class="lineno"> 5187</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05188"></a><span class="lineno"> 5188</span>&#160; </div>
<div class="line"><a name="l05189"></a><span class="lineno"> 5189</span>&#160;    ptiT = NULL;</div>
<div class="line"><a name="l05190"></a><span class="lineno"> 5190</span>&#160;    ppqmsgD = NULL;</div>
<div class="line"><a name="l05191"></a><span class="lineno"> 5191</span>&#160;    pmlInput = NULL;</div>
<div class="line"><a name="l05192"></a><span class="lineno"> 5192</span>&#160; </div>
<div class="line"><a name="l05193"></a><span class="lineno"> 5193</span>&#160;    <span class="keywordflow">while</span> (pqmsgS != NULL) {</div>
<div class="line"><a name="l05194"></a><span class="lineno"> 5194</span>&#160; </div>
<div class="line"><a name="l05195"></a><span class="lineno"> 5195</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05196"></a><span class="lineno"> 5196</span>&#160;<span class="comment">         * Find out where this message should go.</span></div>
<div class="line"><a name="l05197"></a><span class="lineno"> 5197</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05198"></a><span class="lineno"> 5198</span>&#160;        ptiSave = ptiT;</div>
<div class="line"><a name="l05199"></a><span class="lineno"> 5199</span>&#160;        ptiT = pqmsgS-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>;</div>
<div class="line"><a name="l05200"></a><span class="lineno"> 5200</span>&#160; </div>
<div class="line"><a name="l05201"></a><span class="lineno"> 5201</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05202"></a><span class="lineno"> 5202</span>&#160;<span class="comment">         * Get rid of some event messages.</span></div>
<div class="line"><a name="l05203"></a><span class="lineno"> 5203</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l05204"></a><span class="lineno"> 5204</span>&#160;<span class="comment">         * QEVENT_UPDATEKEYSTATE: key state already up to date</span></div>
<div class="line"><a name="l05205"></a><span class="lineno"> 5205</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05206"></a><span class="lineno"> 5206</span>&#160;        <span class="keywordflow">if</span> (pqmsgS-&gt;<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a> == QEVENT_UPDATEKEYSTATE) {</div>
<div class="line"><a name="l05207"></a><span class="lineno"> 5207</span>&#160;            ptiT = NULL;</div>
<div class="line"><a name="l05208"></a><span class="lineno"> 5208</span>&#160;        }</div>
<div class="line"><a name="l05209"></a><span class="lineno"> 5209</span>&#160; </div>
<div class="line"><a name="l05210"></a><span class="lineno"> 5210</span>&#160;        <span class="keywordflow">if</span> (ptiT == NULL) {</div>
<div class="line"><a name="l05211"></a><span class="lineno"> 5211</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05212"></a><span class="lineno"> 5212</span>&#160;<span class="comment">             * Unlink it. pqmsgS should be the first in the list</span></div>
<div class="line"><a name="l05213"></a><span class="lineno"> 5213</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05214"></a><span class="lineno"> 5214</span>&#160; </div>
<div class="line"><a name="l05215"></a><span class="lineno"> 5215</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!pqmsgS-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>);</div>
<div class="line"><a name="l05216"></a><span class="lineno"> 5216</span>&#160;            <span class="keywordflow">if</span> (pqmsgS-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a> != NULL) {</div>
<div class="line"><a name="l05217"></a><span class="lineno"> 5217</span>&#160;                pqmsgS-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = NULL;</div>
<div class="line"><a name="l05218"></a><span class="lineno"> 5218</span>&#160;            }</div>
<div class="line"><a name="l05219"></a><span class="lineno"> 5219</span>&#160; </div>
<div class="line"><a name="l05220"></a><span class="lineno"> 5220</span>&#160;            pqmsgT = pqmsgS;</div>
<div class="line"><a name="l05221"></a><span class="lineno"> 5221</span>&#160;            pqmsgS = pqmsgS-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l05222"></a><span class="lineno"> 5222</span>&#160; </div>
<div class="line"><a name="l05223"></a><span class="lineno"> 5223</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05224"></a><span class="lineno"> 5224</span>&#160;<span class="comment">             * Clean it / free it.</span></div>
<div class="line"><a name="l05225"></a><span class="lineno"> 5225</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05226"></a><span class="lineno"> 5226</span>&#160;            <a class="code" href="a03290.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a>(pqmsgT);</div>
<div class="line"><a name="l05227"></a><span class="lineno"> 5227</span>&#160;            <a class="code" href="a03290.html#a51cfc38140186482e8362d7bf1d3aa20">FreeQEntry</a>(pqmsgT);</div>
<div class="line"><a name="l05228"></a><span class="lineno"> 5228</span>&#160; </div>
<div class="line"><a name="l05229"></a><span class="lineno"> 5229</span>&#160;            ptiT = ptiSave;</div>
<div class="line"><a name="l05230"></a><span class="lineno"> 5230</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l05231"></a><span class="lineno"> 5231</span>&#160;        }</div>
<div class="line"><a name="l05232"></a><span class="lineno"> 5232</span>&#160; </div>
<div class="line"><a name="l05233"></a><span class="lineno"> 5233</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05234"></a><span class="lineno"> 5234</span>&#160;<span class="comment">         * Point to the pointer that points to the first message</span></div>
<div class="line"><a name="l05235"></a><span class="lineno"> 5235</span>&#160;<span class="comment">         * that this message should go to, so that pointer is easy to</span></div>
<div class="line"><a name="l05236"></a><span class="lineno"> 5236</span>&#160;<span class="comment">         * update, no matter where it is.</span></div>
<div class="line"><a name="l05237"></a><span class="lineno"> 5237</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05238"></a><span class="lineno"> 5238</span>&#160;        <span class="keywordflow">if</span> (ppqmsgD == NULL || ptiSave != ptiT) {</div>
<div class="line"><a name="l05239"></a><span class="lineno"> 5239</span>&#160; </div>
<div class="line"><a name="l05240"></a><span class="lineno"> 5240</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05241"></a><span class="lineno"> 5241</span>&#160;<span class="comment">             * If the source is younger than the last message in the</span></div>
<div class="line"><a name="l05242"></a><span class="lineno"> 5242</span>&#160;<span class="comment">             * destination, go to the end.  Otherwise, start at the</span></div>
<div class="line"><a name="l05243"></a><span class="lineno"> 5243</span>&#160;<span class="comment">             * head of the desination list and find a place to insert</span></div>
<div class="line"><a name="l05244"></a><span class="lineno"> 5244</span>&#160;<span class="comment">             * the message.</span></div>
<div class="line"><a name="l05245"></a><span class="lineno"> 5245</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05246"></a><span class="lineno"> 5246</span>&#160;            <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> != NULL &amp;&amp;</div>
<div class="line"><a name="l05247"></a><span class="lineno"> 5247</span>&#160;                    pqmsgS-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time &gt;= ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time) {</div>
<div class="line"><a name="l05248"></a><span class="lineno"> 5248</span>&#160;                ppqmsgD = &amp;ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l05249"></a><span class="lineno"> 5249</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05250"></a><span class="lineno"> 5250</span>&#160;                ppqmsgD = &amp;ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l05251"></a><span class="lineno"> 5251</span>&#160;            }</div>
<div class="line"><a name="l05252"></a><span class="lineno"> 5252</span>&#160; </div>
<div class="line"><a name="l05253"></a><span class="lineno"> 5253</span>&#160;            pmlInput = &amp;ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>;</div>
<div class="line"><a name="l05254"></a><span class="lineno"> 5254</span>&#160;        }</div>
<div class="line"><a name="l05255"></a><span class="lineno"> 5255</span>&#160; </div>
<div class="line"><a name="l05256"></a><span class="lineno"> 5256</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05257"></a><span class="lineno"> 5257</span>&#160;<span class="comment">         * If we&#39;re not at the end of the destination AND the destination</span></div>
<div class="line"><a name="l05258"></a><span class="lineno"> 5258</span>&#160;<span class="comment">         * message time is younger than the source time, go on to</span></div>
<div class="line"><a name="l05259"></a><span class="lineno"> 5259</span>&#160;<span class="comment">         * the next message.</span></div>
<div class="line"><a name="l05260"></a><span class="lineno"> 5260</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05261"></a><span class="lineno"> 5261</span>&#160;        <span class="keywordflow">while</span> (*ppqmsgD != NULL &amp;&amp; ((*ppqmsgD)-&gt;msg.time &lt;= pqmsgS-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time)) {</div>
<div class="line"><a name="l05262"></a><span class="lineno"> 5262</span>&#160;            ppqmsgD = &amp;((*ppqmsgD)-&gt;pqmsgNext);</div>
<div class="line"><a name="l05263"></a><span class="lineno"> 5263</span>&#160;        }</div>
<div class="line"><a name="l05264"></a><span class="lineno"> 5264</span>&#160; </div>
<div class="line"><a name="l05265"></a><span class="lineno"> 5265</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05266"></a><span class="lineno"> 5266</span>&#160;<span class="comment">         * Link in the source before the dest message. Update</span></div>
<div class="line"><a name="l05267"></a><span class="lineno"> 5267</span>&#160;<span class="comment">         * it&#39;s next and prev pointers. Update the dest prev</span></div>
<div class="line"><a name="l05268"></a><span class="lineno"> 5268</span>&#160;<span class="comment">         * pointer.</span></div>
<div class="line"><a name="l05269"></a><span class="lineno"> 5269</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05270"></a><span class="lineno"> 5270</span>&#160;        pqmsgT = pqmsgS;</div>
<div class="line"><a name="l05271"></a><span class="lineno"> 5271</span>&#160;        pqmsgS = pqmsgS-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l05272"></a><span class="lineno"> 5272</span>&#160;        pqmsgT-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a> = *ppqmsgD;</div>
<div class="line"><a name="l05273"></a><span class="lineno"> 5273</span>&#160; </div>
<div class="line"><a name="l05274"></a><span class="lineno"> 5274</span>&#160;        <span class="keywordflow">if</span> (*ppqmsgD != NULL) {</div>
<div class="line"><a name="l05275"></a><span class="lineno"> 5275</span>&#160;            pqmsgT-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = (*ppqmsgD)-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>;</div>
<div class="line"><a name="l05276"></a><span class="lineno"> 5276</span>&#160;            (*ppqmsgD)-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = pqmsgT;</div>
<div class="line"><a name="l05277"></a><span class="lineno"> 5277</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05278"></a><span class="lineno"> 5278</span>&#160;            pqmsgT-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = pmlInput-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>;</div>
<div class="line"><a name="l05279"></a><span class="lineno"> 5279</span>&#160;            pmlInput-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> = pqmsgT;</div>
<div class="line"><a name="l05280"></a><span class="lineno"> 5280</span>&#160;        }</div>
<div class="line"><a name="l05281"></a><span class="lineno"> 5281</span>&#160;        *ppqmsgD = pqmsgT;</div>
<div class="line"><a name="l05282"></a><span class="lineno"> 5282</span>&#160;        ppqmsgD = &amp;pqmsgT-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l05283"></a><span class="lineno"> 5283</span>&#160;        pmlInput-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>++;</div>
<div class="line"><a name="l05284"></a><span class="lineno"> 5284</span>&#160; </div>
<div class="line"><a name="l05285"></a><span class="lineno"> 5285</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05286"></a><span class="lineno"> 5286</span>&#160;<span class="comment">         * Preserve the &#39;idSysPeek&#39; from the old queue.</span></div>
<div class="line"><a name="l05287"></a><span class="lineno"> 5287</span>&#160;<span class="comment">         * Carefull if the redistributed queue is the same as ptiT-&gt;pq.</span></div>
<div class="line"><a name="l05288"></a><span class="lineno"> 5288</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05289"></a><span class="lineno"> 5289</span>&#160;        <span class="keywordflow">if</span> (pqmsgT == (<a class="code" href="a02857.html">PQMSG</a>)(pqRedist-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>) &amp;&amp; (pqRedist != ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>)) {</div>
<div class="line"><a name="l05290"></a><span class="lineno"> 5290</span>&#160; </div>
<div class="line"><a name="l05291"></a><span class="lineno"> 5291</span>&#160;            <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> == 0) {</div>
<div class="line"><a name="l05292"></a><span class="lineno"> 5292</span>&#160;                <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(6, ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, pqRedist-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>);</div>
<div class="line"><a name="l05293"></a><span class="lineno"> 5293</span>&#160;                ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = pqRedist-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>;</div>
<div class="line"><a name="l05294"></a><span class="lineno"> 5294</span>&#160;            }</div>
<div class="line"><a name="l05295"></a><span class="lineno"> 5295</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l05296"></a><span class="lineno"> 5296</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l05297"></a><span class="lineno"> 5297</span>&#160;                KdPrint((<span class="stringliteral">&quot;idSysPeek %lx already set in pq %lx\n&quot;</span>,</div>
<div class="line"><a name="l05298"></a><span class="lineno"> 5298</span>&#160;                    ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a>, ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>));</div>
<div class="line"><a name="l05299"></a><span class="lineno"> 5299</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l05300"></a><span class="lineno"> 5300</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05301"></a><span class="lineno"> 5301</span>&#160;<span class="comment">             * Set the &#39;idSysPeek&#39; of this queue to 0 since</span></div>
<div class="line"><a name="l05302"></a><span class="lineno"> 5302</span>&#160;<span class="comment">             * we moved the idSysPeek to other queue</span></div>
<div class="line"><a name="l05303"></a><span class="lineno"> 5303</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05304"></a><span class="lineno"> 5304</span>&#160;            <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(7, pqRedist, 0);</div>
<div class="line"><a name="l05305"></a><span class="lineno"> 5305</span>&#160;            pqRedist-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l05306"></a><span class="lineno"> 5306</span>&#160; </div>
<div class="line"><a name="l05307"></a><span class="lineno"> 5307</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05308"></a><span class="lineno"> 5308</span>&#160;<span class="comment">             * Preserve also &#39;ptiSysLock&#39;</span></div>
<div class="line"><a name="l05309"></a><span class="lineno"> 5309</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05310"></a><span class="lineno"> 5310</span>&#160;            <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> == NULL) {</div>
<div class="line"><a name="l05311"></a><span class="lineno"> 5311</span>&#160;                <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(4, ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, pqRedist-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>);</div>
<div class="line"><a name="l05312"></a><span class="lineno"> 5312</span>&#160;                ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = pqRedist-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>;</div>
<div class="line"><a name="l05313"></a><span class="lineno"> 5313</span>&#160;                <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(5, pqRedist, NULL);</div>
<div class="line"><a name="l05314"></a><span class="lineno"> 5314</span>&#160;                pqRedist-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = NULL;</div>
<div class="line"><a name="l05315"></a><span class="lineno"> 5315</span>&#160;            }</div>
<div class="line"><a name="l05316"></a><span class="lineno"> 5316</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l05317"></a><span class="lineno"> 5317</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l05318"></a><span class="lineno"> 5318</span>&#160;                KdPrint((<span class="stringliteral">&quot;ptiSysLock %lx already set in pq %lx\n&quot;</span>,</div>
<div class="line"><a name="l05319"></a><span class="lineno"> 5319</span>&#160;                    ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>, ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>));</div>
<div class="line"><a name="l05320"></a><span class="lineno"> 5320</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l05321"></a><span class="lineno"> 5321</span>&#160;        }</div>
<div class="line"><a name="l05322"></a><span class="lineno"> 5322</span>&#160; </div>
<div class="line"><a name="l05323"></a><span class="lineno"> 5323</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05324"></a><span class="lineno"> 5324</span>&#160;<span class="comment">         * Don&#39;t want the prev pointer on our message list to point</span></div>
<div class="line"><a name="l05325"></a><span class="lineno"> 5325</span>&#160;<span class="comment">         * to this message which is on a different list (doesn&#39;t</span></div>
<div class="line"><a name="l05326"></a><span class="lineno"> 5326</span>&#160;<span class="comment">         * really matter because we&#39;re about to link it anyway,</span></div>
<div class="line"><a name="l05327"></a><span class="lineno"> 5327</span>&#160;<span class="comment">         * but completeness shouldn&#39;t hurt).</span></div>
<div class="line"><a name="l05328"></a><span class="lineno"> 5328</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05329"></a><span class="lineno"> 5329</span>&#160;        <span class="keywordflow">if</span> (pqmsgS != NULL) {</div>
<div class="line"><a name="l05330"></a><span class="lineno"> 5330</span>&#160;            pqmsgS-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = NULL;</div>
<div class="line"><a name="l05331"></a><span class="lineno"> 5331</span>&#160;        }</div>
<div class="line"><a name="l05332"></a><span class="lineno"> 5332</span>&#160;    }</div>
<div class="line"><a name="l05333"></a><span class="lineno"> 5333</span>&#160;}</div>
<div class="line"><a name="l05334"></a><span class="lineno"> 5334</span>&#160; </div>
<div class="line"><a name="l05335"></a><span class="lineno"> 5335</span>&#160; </div>
<div class="line"><a name="l05344"></a><span class="lineno"><a class="line" href="a03290.html#a3493fc168759a0e41f7cdc5cb16abde4"> 5344</a></span>&#160;VOID <a class="code" href="a03290.html#a3493fc168759a0e41f7cdc5cb16abde4">CancelInputState</a>(</div>
<div class="line"><a name="l05345"></a><span class="lineno"> 5345</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l05346"></a><span class="lineno"> 5346</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> cmd)</div>
<div class="line"><a name="l05347"></a><span class="lineno"> 5347</span>&#160;{</div>
<div class="line"><a name="l05348"></a><span class="lineno"> 5348</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l05349"></a><span class="lineno"> 5349</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndT;</div>
<div class="line"><a name="l05350"></a><span class="lineno"> 5350</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndT;</div>
<div class="line"><a name="l05351"></a><span class="lineno"> 5351</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndChild;</div>
<div class="line"><a name="l05352"></a><span class="lineno"> 5352</span>&#160;    <a class="code" href="a02757.html">AAS</a> aas;</div>
<div class="line"><a name="l05353"></a><span class="lineno"> 5353</span>&#160; </div>
<div class="line"><a name="l05354"></a><span class="lineno"> 5354</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05355"></a><span class="lineno"> 5355</span>&#160;<span class="comment">     * In all cases, do not leave do any send messages or any callbacks!</span></div>
<div class="line"><a name="l05356"></a><span class="lineno"> 5356</span>&#160;<span class="comment">     * This is because this code is called from</span></div>
<div class="line"><a name="l05357"></a><span class="lineno"> 5357</span>&#160;<span class="comment">     * SetWindowsHook(WH_JOURNALPLAYBACK | WH_JOURNALRECORD). No app currently</span></div>
<div class="line"><a name="l05358"></a><span class="lineno"> 5358</span>&#160;<span class="comment">     * calling this routine expects to be called before this routine returns.</span></div>
<div class="line"><a name="l05359"></a><span class="lineno"> 5359</span>&#160;<span class="comment">     * (If you do callback before it returns, you&#39;ll break at least Access</span></div>
<div class="line"><a name="l05360"></a><span class="lineno"> 5360</span>&#160;<span class="comment">     * for Windows). - scottlu</span></div>
<div class="line"><a name="l05361"></a><span class="lineno"> 5361</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05362"></a><span class="lineno"> 5362</span>&#160;    <span class="keywordflow">switch</span> (cmd) {</div>
<div class="line"><a name="l05363"></a><span class="lineno"> 5363</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a28131755e87cbf28a25b37ad577f0999">CANCEL_ACTIVESTATE</a>:</div>
<div class="line"><a name="l05364"></a><span class="lineno"> 5364</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05365"></a><span class="lineno"> 5365</span>&#160;<span class="comment">         * Active state.</span></div>
<div class="line"><a name="l05366"></a><span class="lineno"> 5366</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05367"></a><span class="lineno"> 5367</span>&#160;        pwndT = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>;</div>
<div class="line"><a name="l05368"></a><span class="lineno"> 5368</span>&#160;        ThreadLockWithPti(ptiCurrent, pwndT, &amp;tlpwndT);</div>
<div class="line"><a name="l05369"></a><span class="lineno"> 5369</span>&#160; </div>
<div class="line"><a name="l05370"></a><span class="lineno"> 5370</span>&#160;        <a class="code" href="a00842.html#a4a4a6ef58238afeb2930d10ed87d2853">QueueNotifyMessage</a>(pwndT, WM_NCACTIVATE, FALSE, 0);</div>
<div class="line"><a name="l05371"></a><span class="lineno"> 5371</span>&#160;        <a class="code" href="a00842.html#a4a4a6ef58238afeb2930d10ed87d2853">QueueNotifyMessage</a>(pwndT, WM_ACTIVATE,</div>
<div class="line"><a name="l05372"></a><span class="lineno"> 5372</span>&#160;                MAKELONG(WA_INACTIVE, TestWF(pwndT, WFMINIMIZED)),</div>
<div class="line"><a name="l05373"></a><span class="lineno"> 5373</span>&#160;                (LONG)NULL);</div>
<div class="line"><a name="l05374"></a><span class="lineno"> 5374</span>&#160; </div>
<div class="line"><a name="l05375"></a><span class="lineno"> 5375</span>&#160;        <span class="keywordflow">if</span> (pwndT == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>)</div>
<div class="line"><a name="l05376"></a><span class="lineno"> 5376</span>&#160;            Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>);</div>
<div class="line"><a name="l05377"></a><span class="lineno"> 5377</span>&#160; </div>
<div class="line"><a name="l05378"></a><span class="lineno"> 5378</span>&#160;        aas.<a class="code" href="a02757.html#a612c8d0305d93a525da7ab198f1bdf0b">ptiNotify</a> = GETPTI(pwndT);</div>
<div class="line"><a name="l05379"></a><span class="lineno"> 5379</span>&#160;        aas.<a class="code" href="a02757.html#aa2f09a6cb1d75cf4ee45937849af1dc6">tidActDeact</a> = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)GETPTI(pwndT)-&gt;Thread-&gt;Cid.UniqueThread;</div>
<div class="line"><a name="l05380"></a><span class="lineno"> 5380</span>&#160;        aas.<a class="code" href="a02757.html#ae5d494d4bc4e4a8a1181eefa82b37b5d">fActivating</a> = FALSE;</div>
<div class="line"><a name="l05381"></a><span class="lineno"> 5381</span>&#160;        aas.<a class="code" href="a02757.html#ab68df3fa1c26a296ef73482d8f614696">fQueueNotify</a> = TRUE;</div>
<div class="line"><a name="l05382"></a><span class="lineno"> 5382</span>&#160; </div>
<div class="line"><a name="l05383"></a><span class="lineno"> 5383</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05384"></a><span class="lineno"> 5384</span>&#160;<span class="comment">         * Even though this in an xxx call, it does NOT leave any critical</span></div>
<div class="line"><a name="l05385"></a><span class="lineno"> 5385</span>&#160;<span class="comment">         * sections (because fQueueNotify is TRUE).</span></div>
<div class="line"><a name="l05386"></a><span class="lineno"> 5386</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05387"></a><span class="lineno"> 5387</span>&#160;        ThreadLockWithPti(ptiCurrent, GETPTI(pwndT)-&gt;rpdesk-&gt;<a class="code" href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>-&gt;<a class="code" href="a02581.html#a6171c9000ea2060597a9bcf498ee0316">spwndChild</a>, &amp;tlpwndChild);</div>
<div class="line"><a name="l05388"></a><span class="lineno"> 5388</span>&#160;        <a class="code" href="a00674.html#a81a2552e2ea04adc0457e7e4649b1cc8">xxxInternalEnumWindow</a>(GETPTI(pwndT)-&gt;rpdesk-&gt;pDeskInfo-&gt;spwnd-&gt;spwndChild,</div>
<div class="line"><a name="l05389"></a><span class="lineno"> 5389</span>&#160;                (<a class="code" href="a00365.html#a3817ddad535f05817212be6d68e976bf">WNDENUMPROC_PWND</a>)<a class="code" href="a00686.html#a4252e9b246034444b0cdd9eb3474b432">xxxActivateApp</a>, (LONG)&amp;aas, BWL_ENUMLIST);</div>
<div class="line"><a name="l05390"></a><span class="lineno"> 5390</span>&#160;        ThreadUnlock(&amp;tlpwndChild);</div>
<div class="line"><a name="l05391"></a><span class="lineno"> 5391</span>&#160; </div>
<div class="line"><a name="l05392"></a><span class="lineno"> 5392</span>&#160;        ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l05393"></a><span class="lineno"> 5393</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05394"></a><span class="lineno"> 5394</span>&#160; </div>
<div class="line"><a name="l05395"></a><span class="lineno"> 5395</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#ad583843a0b492cedbd2015698a00caae">CANCEL_FOCUSSTATE</a>:</div>
<div class="line"><a name="l05396"></a><span class="lineno"> 5396</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05397"></a><span class="lineno"> 5397</span>&#160;<span class="comment">         * Focus state.</span></div>
<div class="line"><a name="l05398"></a><span class="lineno"> 5398</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05399"></a><span class="lineno"> 5399</span>&#160;        pwndT = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>;</div>
<div class="line"><a name="l05400"></a><span class="lineno"> 5400</span>&#160;        ThreadLockWithPti(ptiCurrent, pwndT, &amp;tlpwndT);</div>
<div class="line"><a name="l05401"></a><span class="lineno"> 5401</span>&#160; </div>
<div class="line"><a name="l05402"></a><span class="lineno"> 5402</span>&#160;        <a class="code" href="a00842.html#a4a4a6ef58238afeb2930d10ed87d2853">QueueNotifyMessage</a>(pwndT, WM_KILLFOCUS, 0, 0);</div>
<div class="line"><a name="l05403"></a><span class="lineno"> 5403</span>&#160;        <span class="keywordflow">if</span> (pwndT == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>)</div>
<div class="line"><a name="l05404"></a><span class="lineno"> 5404</span>&#160;            Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>);</div>
<div class="line"><a name="l05405"></a><span class="lineno"> 5405</span>&#160; </div>
<div class="line"><a name="l05406"></a><span class="lineno"> 5406</span>&#160;        ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l05407"></a><span class="lineno"> 5407</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05408"></a><span class="lineno"> 5408</span>&#160; </div>
<div class="line"><a name="l05409"></a><span class="lineno"> 5409</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a3f5fcf81ee185d4981c54b9a7fbcf264">CANCEL_CAPTURESTATE</a>:</div>
<div class="line"><a name="l05410"></a><span class="lineno"> 5410</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05411"></a><span class="lineno"> 5411</span>&#160;<span class="comment">         * Capture state.</span></div>
<div class="line"><a name="l05412"></a><span class="lineno"> 5412</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05413"></a><span class="lineno"> 5413</span>&#160;        pwndT = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>;</div>
<div class="line"><a name="l05414"></a><span class="lineno"> 5414</span>&#160;        ThreadLockWithPti(ptiCurrent, pwndT, &amp;tlpwndT);</div>
<div class="line"><a name="l05415"></a><span class="lineno"> 5415</span>&#160; </div>
<div class="line"><a name="l05416"></a><span class="lineno"> 5416</span>&#160;        <a class="code" href="a00842.html#a4a4a6ef58238afeb2930d10ed87d2853">QueueNotifyMessage</a>(pwndT, WM_CANCELMODE, 0, 0);</div>
<div class="line"><a name="l05417"></a><span class="lineno"> 5417</span>&#160;        <span class="keywordflow">if</span> (pwndT == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>)</div>
<div class="line"><a name="l05418"></a><span class="lineno"> 5418</span>&#160;            Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>);</div>
<div class="line"><a name="l05419"></a><span class="lineno"> 5419</span>&#160; </div>
<div class="line"><a name="l05420"></a><span class="lineno"> 5420</span>&#160;        ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l05421"></a><span class="lineno"> 5421</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05422"></a><span class="lineno"> 5422</span>&#160;    }</div>
<div class="line"><a name="l05423"></a><span class="lineno"> 5423</span>&#160; </div>
<div class="line"><a name="l05424"></a><span class="lineno"> 5424</span>&#160;    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05425"></a><span class="lineno"> 5425</span>&#160;}</div>
<div class="line"><a name="l05426"></a><span class="lineno"> 5426</span>&#160; </div>
<div class="line"><a name="l05427"></a><span class="lineno"> 5427</span>&#160; </div>
<div class="line"><a name="l05439"></a><span class="lineno"><a class="line" href="a03290.html#ae67dbba779f94ec0d718ab4596368c53"> 5439</a></span>&#160;<span class="preprocessor">#define CTS_DONOTHING 0</span></div>
<div class="line"><a name="l05440"></a><span class="lineno"><a class="line" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024"> 5440</a></span>&#160;<span class="preprocessor">#define CTS_CANCELOLD 1</span></div>
<div class="line"><a name="l05441"></a><span class="lineno"><a class="line" href="a03290.html#a20d5203e35ce4aba335668b5bac40170"> 5441</a></span>&#160;<span class="preprocessor">#define CTS_TRANSFER  2</span></div>
<div class="line"><a name="l05442"></a><span class="lineno"> 5442</span>&#160; </div>
<div class="line"><a name="l05443"></a><span class="lineno"><a class="line" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e"> 5443</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a>(</div>
<div class="line"><a name="l05444"></a><span class="lineno"> 5444</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l05445"></a><span class="lineno"> 5445</span>&#160;    <a class="code" href="a02869.html">PQ</a> pqAttach,</div>
<div class="line"><a name="l05446"></a><span class="lineno"> 5446</span>&#160;    LONG offset,</div>
<div class="line"><a name="l05447"></a><span class="lineno"> 5447</span>&#160;    BOOL fJoiningForeground)</div>
<div class="line"><a name="l05448"></a><span class="lineno"> 5448</span>&#160;{</div>
<div class="line"><a name="l05449"></a><span class="lineno"> 5449</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndOld, pwndNew, pwndForegroundState;</div>
<div class="line"><a name="l05450"></a><span class="lineno"> 5450</span>&#160; </div>
<div class="line"><a name="l05451"></a><span class="lineno"> 5451</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05452"></a><span class="lineno"> 5452</span>&#160;<span class="comment">     * return 0: do nothing.</span></div>
<div class="line"><a name="l05453"></a><span class="lineno"> 5453</span>&#160;<span class="comment">     * return 1: cancel the old state.</span></div>
<div class="line"><a name="l05454"></a><span class="lineno"> 5454</span>&#160;<span class="comment">     * return 2: transfer the old state to the new state</span></div>
<div class="line"><a name="l05455"></a><span class="lineno"> 5455</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05456"></a><span class="lineno"> 5456</span>&#160;    pwndOld = *(<a class="code" href="a02581.html">PWND</a> *)(((BYTE *)pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) + offset);</div>
<div class="line"><a name="l05457"></a><span class="lineno"> 5457</span>&#160;    pwndNew = *(<a class="code" href="a02581.html">PWND</a> *)(((BYTE *)pqAttach) + offset);</div>
<div class="line"><a name="l05458"></a><span class="lineno"> 5458</span>&#160; </div>
<div class="line"><a name="l05459"></a><span class="lineno"> 5459</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05460"></a><span class="lineno"> 5460</span>&#160;<span class="comment">     * Make sure the old state even exists, and that the old state is</span></div>
<div class="line"><a name="l05461"></a><span class="lineno"> 5461</span>&#160;<span class="comment">     * owned by this thread. If not, nothing happens.</span></div>
<div class="line"><a name="l05462"></a><span class="lineno"> 5462</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05463"></a><span class="lineno"> 5463</span>&#160;    <span class="keywordflow">if</span> (pwndOld == NULL || GETPTI(pwndOld) != pti)</div>
<div class="line"><a name="l05464"></a><span class="lineno"> 5464</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#ae67dbba779f94ec0d718ab4596368c53">CTS_DONOTHING</a>;</div>
<div class="line"><a name="l05465"></a><span class="lineno"> 5465</span>&#160; </div>
<div class="line"><a name="l05466"></a><span class="lineno"> 5466</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05467"></a><span class="lineno"> 5467</span>&#160;<span class="comment">     * If the new state already exists, cancel the old state.</span></div>
<div class="line"><a name="l05468"></a><span class="lineno"> 5468</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05469"></a><span class="lineno"> 5469</span>&#160;    <span class="keywordflow">if</span> (pwndNew != NULL)</div>
<div class="line"><a name="l05470"></a><span class="lineno"> 5470</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>;</div>
<div class="line"><a name="l05471"></a><span class="lineno"> 5471</span>&#160; </div>
<div class="line"><a name="l05472"></a><span class="lineno"> 5472</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05473"></a><span class="lineno"> 5473</span>&#160;<span class="comment">     * Transfer this old state if this thread is not joining the foreground.</span></div>
<div class="line"><a name="l05474"></a><span class="lineno"> 5474</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05475"></a><span class="lineno"> 5475</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> == NULL || !fJoiningForeground)</div>
<div class="line"><a name="l05476"></a><span class="lineno"> 5476</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>;</div>
<div class="line"><a name="l05477"></a><span class="lineno"> 5477</span>&#160; </div>
<div class="line"><a name="l05478"></a><span class="lineno"> 5478</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05479"></a><span class="lineno"> 5479</span>&#160;<span class="comment">     * We&#39;re joining the foreground - only transfer the old state if we own</span></div>
<div class="line"><a name="l05480"></a><span class="lineno"> 5480</span>&#160;<span class="comment">     * that foreground state or if there is no foreground state.</span></div>
<div class="line"><a name="l05481"></a><span class="lineno"> 5481</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05482"></a><span class="lineno"> 5482</span>&#160;    pwndForegroundState = *(<a class="code" href="a02581.html">PWND</a> *)(((BYTE *)<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>) + offset);</div>
<div class="line"><a name="l05483"></a><span class="lineno"> 5483</span>&#160;    <span class="keywordflow">if</span> (pwndForegroundState == NULL || pwndOld == pwndForegroundState)</div>
<div class="line"><a name="l05484"></a><span class="lineno"> 5484</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>;</div>
<div class="line"><a name="l05485"></a><span class="lineno"> 5485</span>&#160; </div>
<div class="line"><a name="l05486"></a><span class="lineno"> 5486</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05487"></a><span class="lineno"> 5487</span>&#160;<span class="comment">     * We&#39;re joining the foreground but we didn&#39;t set that foreground state.</span></div>
<div class="line"><a name="l05488"></a><span class="lineno"> 5488</span>&#160;<span class="comment">     * Don&#39;t allow the transfer of that state.</span></div>
<div class="line"><a name="l05489"></a><span class="lineno"> 5489</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05490"></a><span class="lineno"> 5490</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>;</div>
<div class="line"><a name="l05491"></a><span class="lineno"> 5491</span>&#160;}</div>
<div class="line"><a name="l05492"></a><span class="lineno"> 5492</span>&#160; </div>
<div class="line"><a name="l05493"></a><span class="lineno"><a class="line" href="a00899.html#af3b07178c2d5c967a8b5656b3ebcab5e"> 5493</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03290.html#af3b07178c2d5c967a8b5656b3ebcab5e">AttachToQueue</a>(</div>
<div class="line"><a name="l05494"></a><span class="lineno"> 5494</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l05495"></a><span class="lineno"> 5495</span>&#160;    <a class="code" href="a02869.html">PQ</a>   pqAttach,</div>
<div class="line"><a name="l05496"></a><span class="lineno"> 5496</span>&#160;    <a class="code" href="a02869.html">PQ</a>   pqJournal,</div>
<div class="line"><a name="l05497"></a><span class="lineno"> 5497</span>&#160;    BOOL fJoiningForeground)</div>
<div class="line"><a name="l05498"></a><span class="lineno"> 5498</span>&#160;{</div>
<div class="line"><a name="l05499"></a><span class="lineno"> 5499</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgT;</div>
<div class="line"><a name="l05500"></a><span class="lineno"> 5500</span>&#160;    <a class="code" href="a02869.html">PQ</a> pqDestroy;</div>
<div class="line"><a name="l05501"></a><span class="lineno"> 5501</span>&#160; </div>
<div class="line"><a name="l05502"></a><span class="lineno"> 5502</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05503"></a><span class="lineno"> 5503</span>&#160;<span class="comment">     * Check active state.</span></div>
<div class="line"><a name="l05504"></a><span class="lineno"> 5504</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05505"></a><span class="lineno"> 5505</span>&#160;    <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a>(pti, pqAttach,</div>
<div class="line"><a name="l05506"></a><span class="lineno"> 5506</span>&#160;            FIELD_OFFSET(<a class="code" href="a02869.html">Q</a>, spwndActive), fJoiningForeground)) {</div>
<div class="line"><a name="l05507"></a><span class="lineno"> 5507</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>:</div>
<div class="line"><a name="l05508"></a><span class="lineno"> 5508</span>&#160;        <a class="code" href="a03290.html#a3493fc168759a0e41f7cdc5cb16abde4">CancelInputState</a>(pti, <a class="code" href="a03290.html#a28131755e87cbf28a25b37ad577f0999">CANCEL_ACTIVESTATE</a>);</div>
<div class="line"><a name="l05509"></a><span class="lineno"> 5509</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05510"></a><span class="lineno"> 5510</span>&#160; </div>
<div class="line"><a name="l05511"></a><span class="lineno"> 5511</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>:</div>
<div class="line"><a name="l05512"></a><span class="lineno"> 5512</span>&#160;        Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>);</div>
<div class="line"><a name="l05513"></a><span class="lineno"> 5513</span>&#160; </div>
<div class="line"><a name="l05514"></a><span class="lineno"> 5514</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05515"></a><span class="lineno"> 5515</span>&#160;<span class="comment">         * The caret usually follows the focus window, which follows</span></div>
<div class="line"><a name="l05516"></a><span class="lineno"> 5516</span>&#160;<span class="comment">         * the active window...</span></div>
<div class="line"><a name="l05517"></a><span class="lineno"> 5517</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05518"></a><span class="lineno"> 5518</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a>.<a class="code" href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a> != NULL) {</div>
<div class="line"><a name="l05519"></a><span class="lineno"> 5519</span>&#160; </div>
<div class="line"><a name="l05520"></a><span class="lineno"> 5520</span>&#160;            <span class="keywordflow">if</span> (GETPTI(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a>.<a class="code" href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>) == pti) {</div>
<div class="line"><a name="l05521"></a><span class="lineno"> 5521</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l05522"></a><span class="lineno"> 5522</span>&#160;<span class="comment">                 * Just copy the entire caret structure... that way we</span></div>
<div class="line"><a name="l05523"></a><span class="lineno"> 5523</span>&#160;<span class="comment">                 * don&#39;t need to deal with locking/unlocking the spwnd.</span></div>
<div class="line"><a name="l05524"></a><span class="lineno"> 5524</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l05525"></a><span class="lineno"> 5525</span>&#160;                <span class="keywordflow">if</span> (pqAttach-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a>.<a class="code" href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a> == NULL) {</div>
<div class="line"><a name="l05526"></a><span class="lineno"> 5526</span>&#160;                    pqAttach-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a> = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a>;</div>
<div class="line"><a name="l05527"></a><span class="lineno"> 5527</span>&#160;                    pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a>.<a class="code" href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a> = NULL;</div>
<div class="line"><a name="l05528"></a><span class="lineno"> 5528</span>&#160;                }</div>
<div class="line"><a name="l05529"></a><span class="lineno"> 5529</span>&#160;            }</div>
<div class="line"><a name="l05530"></a><span class="lineno"> 5530</span>&#160;        }</div>
<div class="line"><a name="l05531"></a><span class="lineno"> 5531</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05532"></a><span class="lineno"> 5532</span>&#160;    }</div>
<div class="line"><a name="l05533"></a><span class="lineno"> 5533</span>&#160; </div>
<div class="line"><a name="l05534"></a><span class="lineno"> 5534</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05535"></a><span class="lineno"> 5535</span>&#160;<span class="comment">     * Check focus state.</span></div>
<div class="line"><a name="l05536"></a><span class="lineno"> 5536</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05537"></a><span class="lineno"> 5537</span>&#160;    <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a>(pti, pqAttach,</div>
<div class="line"><a name="l05538"></a><span class="lineno"> 5538</span>&#160;            FIELD_OFFSET(<a class="code" href="a02869.html">Q</a>, spwndFocus), fJoiningForeground)) {</div>
<div class="line"><a name="l05539"></a><span class="lineno"> 5539</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>:</div>
<div class="line"><a name="l05540"></a><span class="lineno"> 5540</span>&#160;        <a class="code" href="a03290.html#a3493fc168759a0e41f7cdc5cb16abde4">CancelInputState</a>(pti, <a class="code" href="a03290.html#ad583843a0b492cedbd2015698a00caae">CANCEL_FOCUSSTATE</a>);</div>
<div class="line"><a name="l05541"></a><span class="lineno"> 5541</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05542"></a><span class="lineno"> 5542</span>&#160; </div>
<div class="line"><a name="l05543"></a><span class="lineno"> 5543</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>:</div>
<div class="line"><a name="l05544"></a><span class="lineno"> 5544</span>&#160;        Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>);</div>
<div class="line"><a name="l05545"></a><span class="lineno"> 5545</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05546"></a><span class="lineno"> 5546</span>&#160;    }</div>
<div class="line"><a name="l05547"></a><span class="lineno"> 5547</span>&#160; </div>
<div class="line"><a name="l05548"></a><span class="lineno"> 5548</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05549"></a><span class="lineno"> 5549</span>&#160;<span class="comment">     * Check capture state.</span></div>
<div class="line"><a name="l05550"></a><span class="lineno"> 5550</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05551"></a><span class="lineno"> 5551</span>&#160;    <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a>(pti, pqAttach,</div>
<div class="line"><a name="l05552"></a><span class="lineno"> 5552</span>&#160;            FIELD_OFFSET(<a class="code" href="a02869.html">Q</a>, spwndCapture), fJoiningForeground)) {</div>
<div class="line"><a name="l05553"></a><span class="lineno"> 5553</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>:</div>
<div class="line"><a name="l05554"></a><span class="lineno"> 5554</span>&#160;        <a class="code" href="a03290.html#a3493fc168759a0e41f7cdc5cb16abde4">CancelInputState</a>(pti, <a class="code" href="a03290.html#a3f5fcf81ee185d4981c54b9a7fbcf264">CANCEL_CAPTURESTATE</a>);</div>
<div class="line"><a name="l05555"></a><span class="lineno"> 5555</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05556"></a><span class="lineno"> 5556</span>&#160; </div>
<div class="line"><a name="l05557"></a><span class="lineno"> 5557</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>:</div>
<div class="line"><a name="l05558"></a><span class="lineno"> 5558</span>&#160;        Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>);</div>
<div class="line"><a name="l05559"></a><span class="lineno"> 5559</span>&#160;        pqAttach-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a> = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">codeCapture</a>;</div>
<div class="line"><a name="l05560"></a><span class="lineno"> 5560</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05561"></a><span class="lineno"> 5561</span>&#160;    }</div>
<div class="line"><a name="l05562"></a><span class="lineno"> 5562</span>&#160; </div>
<div class="line"><a name="l05563"></a><span class="lineno"> 5563</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05564"></a><span class="lineno"> 5564</span>&#160;<span class="comment">     * Check mouse tracking state.</span></div>
<div class="line"><a name="l05565"></a><span class="lineno"> 5565</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05566"></a><span class="lineno"> 5566</span>&#160;    <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a>(pti, pqAttach,</div>
<div class="line"><a name="l05567"></a><span class="lineno"> 5567</span>&#160;            FIELD_OFFSET(<a class="code" href="a02869.html">Q</a>, spwndLastMouseMessage), fJoiningForeground)) {</div>
<div class="line"><a name="l05568"></a><span class="lineno"> 5568</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>:</div>
<div class="line"><a name="l05569"></a><span class="lineno"> 5569</span>&#160;        <a class="code" href="a03290.html#ab7a8ea0145ef1df8bfb450d1ac6fed9e">ResetMouseTracking</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, NULL);</div>
<div class="line"><a name="l05570"></a><span class="lineno"> 5570</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05571"></a><span class="lineno"> 5571</span>&#160; </div>
<div class="line"><a name="l05572"></a><span class="lineno"> 5572</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>:</div>
<div class="line"><a name="l05573"></a><span class="lineno"> 5573</span>&#160;        Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>);</div>
<div class="line"><a name="l05574"></a><span class="lineno"> 5574</span>&#160;        pqAttach-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp; (QF_TRACKMOUSEHOVER | QF_TRACKMOUSELEAVE);</div>
<div class="line"><a name="l05575"></a><span class="lineno"> 5575</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05576"></a><span class="lineno"> 5576</span>&#160;    }</div>
<div class="line"><a name="l05577"></a><span class="lineno"> 5577</span>&#160; </div>
<div class="line"><a name="l05578"></a><span class="lineno"> 5578</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05579"></a><span class="lineno"> 5579</span>&#160;<span class="comment">     * Check spwndActivePrev state.  This check has some considerations.</span></div>
<div class="line"><a name="l05580"></a><span class="lineno"> 5580</span>&#160;<span class="comment">     * If the CTS_TRANSFER is returned, it usually means there was no</span></div>
<div class="line"><a name="l05581"></a><span class="lineno"> 5581</span>&#160;<span class="comment">     * prev-active in the attach-queue, and it will use the first</span></div>
<div class="line"><a name="l05582"></a><span class="lineno"> 5582</span>&#160;<span class="comment">     * window it encounters.  Since we walk the thread-list, a out-of-zorder</span></div>
<div class="line"><a name="l05583"></a><span class="lineno"> 5583</span>&#160;<span class="comment">     * window could be chosen.  So, to counter this, we&#39;ll check the</span></div>
<div class="line"><a name="l05584"></a><span class="lineno"> 5584</span>&#160;<span class="comment">     * attach-queue-next-prev against the thread-previous window to see</span></div>
<div class="line"><a name="l05585"></a><span class="lineno"> 5585</span>&#160;<span class="comment">     * if it is truly the next-zorder window.</span></div>
<div class="line"><a name="l05586"></a><span class="lineno"> 5586</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05587"></a><span class="lineno"> 5587</span>&#160;    <span class="keywordflow">switch</span> (<a class="code" href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a>(pti, pqAttach,</div>
<div class="line"><a name="l05588"></a><span class="lineno"> 5588</span>&#160;            FIELD_OFFSET(<a class="code" href="a02869.html">Q</a>, spwndActivePrev), fJoiningForeground)) {</div>
<div class="line"><a name="l05589"></a><span class="lineno"> 5589</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a>:</div>
<div class="line"><a name="l05590"></a><span class="lineno"> 5590</span>&#160;        Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>);</div>
<div class="line"><a name="l05591"></a><span class="lineno"> 5591</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05592"></a><span class="lineno"> 5592</span>&#160; </div>
<div class="line"><a name="l05593"></a><span class="lineno"> 5593</span>&#160;    <span class="keywordflow">case</span> <a class="code" href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a>:</div>
<div class="line"><a name="l05594"></a><span class="lineno"> 5594</span>&#160; </div>
<div class="line"><a name="l05595"></a><span class="lineno"> 5595</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05596"></a><span class="lineno"> 5596</span>&#160;<span class="comment">         * Check to see if the previous window is what we would expect it</span></div>
<div class="line"><a name="l05597"></a><span class="lineno"> 5597</span>&#160;<span class="comment">         * to be.</span></div>
<div class="line"><a name="l05598"></a><span class="lineno"> 5598</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05599"></a><span class="lineno"> 5599</span>&#160;        <span class="keywordflow">if</span> (pqAttach-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> &amp;&amp;</div>
<div class="line"><a name="l05600"></a><span class="lineno"> 5600</span>&#160;            (pqAttach-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a> &amp;&amp; pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>) &amp;&amp;</div>
<div class="line"><a name="l05601"></a><span class="lineno"> 5601</span>&#160;            (pqAttach-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>-&gt;<a class="code" href="a02581.html#af729b7de7a8fb84b70b70c4b401ce789">spwndNext</a> == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>)) {</div>
<div class="line"><a name="l05602"></a><span class="lineno"> 5602</span>&#160; </div>
<div class="line"><a name="l05603"></a><span class="lineno"> 5603</span>&#160;            Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>);</div>
<div class="line"><a name="l05604"></a><span class="lineno"> 5604</span>&#160;        }</div>
<div class="line"><a name="l05605"></a><span class="lineno"> 5605</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05606"></a><span class="lineno"> 5606</span>&#160;    }</div>
<div class="line"><a name="l05607"></a><span class="lineno"> 5607</span>&#160; </div>
<div class="line"><a name="l05608"></a><span class="lineno"> 5608</span>&#160;    <span class="keywordflow">if</span> (pti == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a>) {</div>
<div class="line"><a name="l05609"></a><span class="lineno"> 5609</span>&#160;        pqAttach-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a>;</div>
<div class="line"><a name="l05610"></a><span class="lineno"> 5610</span>&#160; </div>
<div class="line"><a name="l05611"></a><span class="lineno"> 5611</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05612"></a><span class="lineno"> 5612</span>&#160;<span class="comment">         *  Fix for 29967 &quot;Start menu disappears when clicked  and Office</span></div>
<div class="line"><a name="l05613"></a><span class="lineno"> 5613</span>&#160;<span class="comment">         *  taskbar has focus!&quot;. Win95 uses a global counter instead of this</span></div>
<div class="line"><a name="l05614"></a><span class="lineno"> 5614</span>&#160;<span class="comment">         *  flag. In NT when we click on Office taskbar and then on the Start</span></div>
<div class="line"><a name="l05615"></a><span class="lineno"> 5615</span>&#160;<span class="comment">         *  Menu, MSoffice calls AttachThreadInput() which changes the Start</span></div>
<div class="line"><a name="l05616"></a><span class="lineno"> 5616</span>&#160;<span class="comment">         *  Menu&#39;s queue and the new queue has the QF_ACTIVATIONCHANGE flag on.</span></div>
<div class="line"><a name="l05617"></a><span class="lineno"> 5617</span>&#160;<span class="comment">         *  Inside the xxxMNLoop we test if this flag is on and if it is we</span></div>
<div class="line"><a name="l05618"></a><span class="lineno"> 5618</span>&#160;<span class="comment">         *  exit the menu.</span></div>
<div class="line"><a name="l05619"></a><span class="lineno"> 5619</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05620"></a><span class="lineno"> 5620</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="a00899.html#af22598950c2f41d596373168bd1e15ef">IsInsideMenuLoop</a>(pti)) {</div>
<div class="line"><a name="l05621"></a><span class="lineno"> 5621</span>&#160;            pqAttach-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_ACTIVATIONCHANGE;</div>
<div class="line"><a name="l05622"></a><span class="lineno"> 5622</span>&#160;        }</div>
<div class="line"><a name="l05623"></a><span class="lineno"> 5623</span>&#160;    }</div>
<div class="line"><a name="l05624"></a><span class="lineno"> 5624</span>&#160; </div>
<div class="line"><a name="l05625"></a><span class="lineno"> 5625</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a2cff4327a97c844cd113c0dae7541390">gspwndCursor</a> != NULL &amp;&amp; pti == GETPTI(<a class="code" href="a03257.html#a2cff4327a97c844cd113c0dae7541390">gspwndCursor</a>)) {</div>
<div class="line"><a name="l05626"></a><span class="lineno"> 5626</span>&#160;        <a class="code" href="a00638.html#a439658ba5849cd209ffc346d05cb508b">LockQCursor</a>(pqAttach, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a683294acdd2ae8355c6cfbf49c260374">spcurCurrent</a>);</div>
<div class="line"><a name="l05627"></a><span class="lineno"> 5627</span>&#160;    }</div>
<div class="line"><a name="l05628"></a><span class="lineno"> 5628</span>&#160; </div>
<div class="line"><a name="l05629"></a><span class="lineno"> 5629</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05630"></a><span class="lineno"> 5630</span>&#160;<span class="comment">     * Each thread has its own cursor level, which is a count of the number</span></div>
<div class="line"><a name="l05631"></a><span class="lineno"> 5631</span>&#160;<span class="comment">     * of times that app has called show/hide cursor. This gets added into</span></div>
<div class="line"><a name="l05632"></a><span class="lineno"> 5632</span>&#160;<span class="comment">     * the queue&#39;s count for a completely accurate count every time this</span></div>
<div class="line"><a name="l05633"></a><span class="lineno"> 5633</span>&#160;<span class="comment">     * queue recalculation is done.</span></div>
<div class="line"><a name="l05634"></a><span class="lineno"> 5634</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05635"></a><span class="lineno"> 5635</span>&#160;    pqAttach-&gt;<a class="code" href="a02869.html#a97845e5f321fb758821ac99bd53840de">iCursorLevel</a> += pti-&gt;<a class="code" href="a02889.html#a97845e5f321fb758821ac99bd53840de">iCursorLevel</a>;</div>
<div class="line"><a name="l05636"></a><span class="lineno"> 5636</span>&#160; </div>
<div class="line"><a name="l05637"></a><span class="lineno"> 5637</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05638"></a><span class="lineno"> 5638</span>&#160;<span class="comment">     * Pump up the new queue with the right input variables.</span></div>
<div class="line"><a name="l05639"></a><span class="lineno"> 5639</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05640"></a><span class="lineno"> 5640</span>&#160;    pqAttach-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a>    = pti;</div>
<div class="line"><a name="l05641"></a><span class="lineno"> 5641</span>&#160;    pqAttach-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> = pti;</div>
<div class="line"><a name="l05642"></a><span class="lineno"> 5642</span>&#160; </div>
<div class="line"><a name="l05643"></a><span class="lineno"> 5643</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05644"></a><span class="lineno"> 5644</span>&#160;<span class="comment">     * Grab the alt-tab window if it exists and we don&#39;t already have</span></div>
<div class="line"><a name="l05645"></a><span class="lineno"> 5645</span>&#160;<span class="comment">     * one.  Queues other than the RIT can have alt-tab windows, so</span></div>
<div class="line"><a name="l05646"></a><span class="lineno"> 5646</span>&#160;<span class="comment">     * we must make sure we clean up the extra windows.</span></div>
<div class="line"><a name="l05647"></a><span class="lineno"> 5647</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05648"></a><span class="lineno"> 5648</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a> != NULL &amp;&amp; GETPTI(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a>) == pti &amp;&amp;</div>
<div class="line"><a name="l05649"></a><span class="lineno"> 5649</span>&#160;            pqAttach-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a> == NULL) {</div>
<div class="line"><a name="l05650"></a><span class="lineno"> 5650</span>&#160;        Lock(&amp;pqAttach-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a>, pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a>);</div>
<div class="line"><a name="l05651"></a><span class="lineno"> 5651</span>&#160;        Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a>);</div>
<div class="line"><a name="l05652"></a><span class="lineno"> 5652</span>&#160;        pqAttach-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_INALTTAB;</div>
<div class="line"><a name="l05653"></a><span class="lineno"> 5653</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_INALTTAB;</div>
<div class="line"><a name="l05654"></a><span class="lineno"> 5654</span>&#160;    }</div>
<div class="line"><a name="l05655"></a><span class="lineno"> 5655</span>&#160; </div>
<div class="line"><a name="l05656"></a><span class="lineno"> 5656</span>&#160;    pqDestroy = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l05657"></a><span class="lineno"> 5657</span>&#160; </div>
<div class="line"><a name="l05658"></a><span class="lineno"> 5658</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05659"></a><span class="lineno"> 5659</span>&#160;<span class="comment">     * Don&#39;t increment the thread count here because we already incremented</span></div>
<div class="line"><a name="l05660"></a><span class="lineno"> 5660</span>&#160;<span class="comment">     * it when we put it in pti-&gt;pqAttach. Since we&#39;re moving it from pqAttach</span></div>
<div class="line"><a name="l05661"></a><span class="lineno"> 5661</span>&#160;<span class="comment">     * to pq, we don&#39;t mess with the reference count.</span></div>
<div class="line"><a name="l05662"></a><span class="lineno"> 5662</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05663"></a><span class="lineno"> 5663</span>&#160;    pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> = pqAttach;</div>
<div class="line"><a name="l05664"></a><span class="lineno"> 5664</span>&#160; </div>
<div class="line"><a name="l05665"></a><span class="lineno"> 5665</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05666"></a><span class="lineno"> 5666</span>&#160;<span class="comment">     * If the thread is using the journal queue, leave the message list</span></div>
<div class="line"><a name="l05667"></a><span class="lineno"> 5667</span>&#160;<span class="comment">     * alone.  Otherwise, redistribute the messages.</span></div>
<div class="line"><a name="l05668"></a><span class="lineno"> 5668</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05669"></a><span class="lineno"> 5669</span>&#160;    <span class="keywordflow">if</span> (pqDestroy != pqJournal) {</div>
<div class="line"><a name="l05670"></a><span class="lineno"> 5670</span>&#160; </div>
<div class="line"><a name="l05671"></a><span class="lineno"> 5671</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05672"></a><span class="lineno"> 5672</span>&#160;<span class="comment">         * Remember the current message list so it can get redistributed taking</span></div>
<div class="line"><a name="l05673"></a><span class="lineno"> 5673</span>&#160;<span class="comment">         * into account ptiAttach&#39;s new queue.</span></div>
<div class="line"><a name="l05674"></a><span class="lineno"> 5674</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05675"></a><span class="lineno"> 5675</span>&#160;        pqmsgT = pqDestroy-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l05676"></a><span class="lineno"> 5676</span>&#160;        pqDestroy-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>      = NULL;</div>
<div class="line"><a name="l05677"></a><span class="lineno"> 5677</span>&#160;        pqDestroy-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> = NULL;</div>
<div class="line"><a name="l05678"></a><span class="lineno"> 5678</span>&#160;        pqDestroy-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>          = 0;</div>
<div class="line"><a name="l05679"></a><span class="lineno"> 5679</span>&#160; </div>
<div class="line"><a name="l05680"></a><span class="lineno"> 5680</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05681"></a><span class="lineno"> 5681</span>&#160;<span class="comment">         * Now redistribute the input messages from the old queue they go into the</span></div>
<div class="line"><a name="l05682"></a><span class="lineno"> 5682</span>&#160;<span class="comment">         * right queues.</span></div>
<div class="line"><a name="l05683"></a><span class="lineno"> 5683</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l05684"></a><span class="lineno"> 5684</span>&#160;<span class="comment">         * Preserve the &#39;idSysPeek&#39; when redistributing the queue</span></div>
<div class="line"><a name="l05685"></a><span class="lineno"> 5685</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05686"></a><span class="lineno"> 5686</span>&#160;        <a class="code" href="a03290.html#aba92d10b804737271611397aecd11ac0">RedistributeInput</a>(pqmsgT, pqDestroy);</div>
<div class="line"><a name="l05687"></a><span class="lineno"> 5687</span>&#160; </div>
<div class="line"><a name="l05688"></a><span class="lineno"> 5688</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05689"></a><span class="lineno"> 5689</span>&#160;<span class="comment">         * Officially attach the new queue to this thread. Note that DestroyQueue()</span></div>
<div class="line"><a name="l05690"></a><span class="lineno"> 5690</span>&#160;<span class="comment">         * doesn&#39;t actually destroy anything until the thread reference count goes</span></div>
<div class="line"><a name="l05691"></a><span class="lineno"> 5691</span>&#160;<span class="comment">         * to 0.</span></div>
<div class="line"><a name="l05692"></a><span class="lineno"> 5692</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05693"></a><span class="lineno"> 5693</span>&#160;        <a class="code" href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a>(pqDestroy, pti);</div>
<div class="line"><a name="l05694"></a><span class="lineno"> 5694</span>&#160; </div>
<div class="line"><a name="l05695"></a><span class="lineno"> 5695</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05696"></a><span class="lineno"> 5696</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqDestroy-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>);</div>
<div class="line"><a name="l05697"></a><span class="lineno"> 5697</span>&#160;        pqDestroy-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>--;</div>
<div class="line"><a name="l05698"></a><span class="lineno"> 5698</span>&#160;    }</div>
<div class="line"><a name="l05699"></a><span class="lineno"> 5699</span>&#160;}</div>
<div class="line"><a name="l05700"></a><span class="lineno"> 5700</span>&#160; </div>
<div class="line"><a name="l05701"></a><span class="lineno"><a class="line" href="a00899.html#a555a50540fc3e5009b8d9262e0702592"> 5701</a></span>&#160;BOOL <a class="code" href="a03290.html#a555a50540fc3e5009b8d9262e0702592">ReattachThreads</a>(</div>
<div class="line"><a name="l05702"></a><span class="lineno"> 5702</span>&#160;    BOOL fJournalAttach)</div>
<div class="line"><a name="l05703"></a><span class="lineno"> 5703</span>&#160;{</div>
<div class="line"><a name="l05704"></a><span class="lineno"> 5704</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l05705"></a><span class="lineno"> 5705</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l05706"></a><span class="lineno"> 5706</span>&#160;    <a class="code" href="a02869.html">PQ</a>          pqForegroundPrevNew;</div>
<div class="line"><a name="l05707"></a><span class="lineno"> 5707</span>&#160;    <a class="code" href="a02869.html">PQ</a>          pqForegroundNew;</div>
<div class="line"><a name="l05708"></a><span class="lineno"> 5708</span>&#160;    <a class="code" href="a02869.html">PQ</a>          pqAttach;</div>
<div class="line"><a name="l05709"></a><span class="lineno"> 5709</span>&#160;    <a class="code" href="a02869.html">PQ</a>          pqJournal;</div>
<div class="line"><a name="l05710"></a><span class="lineno"> 5710</span>&#160;    PLIST_ENTRY pHead, pEntry;</div>
<div class="line"><a name="l05711"></a><span class="lineno"> 5711</span>&#160; </div>
<div class="line"><a name="l05712"></a><span class="lineno"> 5712</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05713"></a><span class="lineno"> 5713</span>&#160;<span class="comment">     * In all cases, do not leave do any send messages or any callbacks!</span></div>
<div class="line"><a name="l05714"></a><span class="lineno"> 5714</span>&#160;<span class="comment">     * This is because this code is called from</span></div>
<div class="line"><a name="l05715"></a><span class="lineno"> 5715</span>&#160;<span class="comment">     * SetWindowsHook(WH_JOURNALPLAYBACK | WH_JOURNALRECORD). No app currently</span></div>
<div class="line"><a name="l05716"></a><span class="lineno"> 5716</span>&#160;<span class="comment">     * calling this routine expects to be called before this routine returns.</span></div>
<div class="line"><a name="l05717"></a><span class="lineno"> 5717</span>&#160;<span class="comment">     * (If you do callback before it returns, you&#39;ll break at least Access</span></div>
<div class="line"><a name="l05718"></a><span class="lineno"> 5718</span>&#160;<span class="comment">     * for Windows). - scottlu</span></div>
<div class="line"><a name="l05719"></a><span class="lineno"> 5719</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05720"></a><span class="lineno"> 5720</span>&#160; </div>
<div class="line"><a name="l05721"></a><span class="lineno"> 5721</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05722"></a><span class="lineno"> 5722</span>&#160;<span class="comment">     * Don&#39;t recalc attach info if this is a journal attach, because</span></div>
<div class="line"><a name="l05723"></a><span class="lineno"> 5723</span>&#160;<span class="comment">     * the journal attach code has already done this for us.</span></div>
<div class="line"><a name="l05724"></a><span class="lineno"> 5724</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05725"></a><span class="lineno"> 5725</span>&#160;    <span class="keywordflow">if</span> (!fJournalAttach) {</div>
<div class="line"><a name="l05726"></a><span class="lineno"> 5726</span>&#160; </div>
<div class="line"><a name="l05727"></a><span class="lineno"> 5727</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05728"></a><span class="lineno"> 5728</span>&#160;<span class="comment">         * Now recalculate all the different queue groups, based on the</span></div>
<div class="line"><a name="l05729"></a><span class="lineno"> 5729</span>&#160;<span class="comment">         * attach requests. This fills in the pqAttach of each thread info</span></div>
<div class="line"><a name="l05730"></a><span class="lineno"> 5730</span>&#160;<span class="comment">         * with the new queue this thread belongs to. Always takes into</span></div>
<div class="line"><a name="l05731"></a><span class="lineno"> 5731</span>&#160;<span class="comment">         * account all attachment requests.</span></div>
<div class="line"><a name="l05732"></a><span class="lineno"> 5732</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05733"></a><span class="lineno"> 5733</span>&#160;        <a class="code" href="a03290.html#a673f9d872c88727c8dd0c627382981f5">RecalcThreadAttachment</a>();</div>
<div class="line"><a name="l05734"></a><span class="lineno"> 5734</span>&#160; </div>
<div class="line"><a name="l05735"></a><span class="lineno"> 5735</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05736"></a><span class="lineno"> 5736</span>&#160;<span class="comment">         * Make a guess about which queue is the journal queue.</span></div>
<div class="line"><a name="l05737"></a><span class="lineno"> 5737</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05738"></a><span class="lineno"> 5738</span>&#160;        pqJournal = <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>;</div>
<div class="line"><a name="l05739"></a><span class="lineno"> 5739</span>&#160;        <span class="keywordflow">if</span> (pqJournal == NULL)</div>
<div class="line"><a name="l05740"></a><span class="lineno"> 5740</span>&#160;            pqJournal = ptiCurrent-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l05741"></a><span class="lineno"> 5741</span>&#160; </div>
<div class="line"><a name="l05742"></a><span class="lineno"> 5742</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05743"></a><span class="lineno"> 5743</span>&#160;<span class="comment">         * If the queue is only used by one thread, perform normal processing.</span></div>
<div class="line"><a name="l05744"></a><span class="lineno"> 5744</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05745"></a><span class="lineno"> 5745</span>&#160;        <span class="keywordflow">if</span> (pqJournal-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> == 1) {</div>
<div class="line"><a name="l05746"></a><span class="lineno"> 5746</span>&#160;            pqJournal = NULL;</div>
<div class="line"><a name="l05747"></a><span class="lineno"> 5747</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05748"></a><span class="lineno"> 5748</span>&#160; </div>
<div class="line"><a name="l05749"></a><span class="lineno"> 5749</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l05750"></a><span class="lineno"> 5750</span>&#160;<span class="comment">             * Lock the queue to ensure that it stays valid</span></div>
<div class="line"><a name="l05751"></a><span class="lineno"> 5751</span>&#160;<span class="comment">             * until we have redistributed the input.</span></div>
<div class="line"><a name="l05752"></a><span class="lineno"> 5752</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l05753"></a><span class="lineno"> 5753</span>&#160;            (pqJournal-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)++;</div>
<div class="line"><a name="l05754"></a><span class="lineno"> 5754</span>&#160;        }</div>
<div class="line"><a name="l05755"></a><span class="lineno"> 5755</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05756"></a><span class="lineno"> 5756</span>&#160;        pqJournal = NULL;</div>
<div class="line"><a name="l05757"></a><span class="lineno"> 5757</span>&#160;    }</div>
<div class="line"><a name="l05758"></a><span class="lineno"> 5758</span>&#160; </div>
<div class="line"><a name="l05759"></a><span class="lineno"> 5759</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05760"></a><span class="lineno"> 5760</span>&#160;<span class="comment">     * What will be the new foreground queue?</span></div>
<div class="line"><a name="l05761"></a><span class="lineno"> 5761</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05762"></a><span class="lineno"> 5762</span>&#160;    pqForegroundNew = NULL;</div>
<div class="line"><a name="l05763"></a><span class="lineno"> 5763</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> != NULL &amp;&amp; <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> != NULL) {</div>
<div class="line"><a name="l05764"></a><span class="lineno"> 5764</span>&#160;        pqForegroundNew = GETPTI(<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>)-&gt;pqAttach;</div>
<div class="line"><a name="l05765"></a><span class="lineno"> 5765</span>&#160;    }</div>
<div class="line"><a name="l05766"></a><span class="lineno"> 5766</span>&#160; </div>
<div class="line"><a name="l05767"></a><span class="lineno"> 5767</span>&#160;    pqForegroundPrevNew = NULL;</div>
<div class="line"><a name="l05768"></a><span class="lineno"> 5768</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a> != NULL &amp;&amp; <a class="code" href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a>-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a> != NULL) {</div>
<div class="line"><a name="l05769"></a><span class="lineno"> 5769</span>&#160;        pqForegroundPrevNew = GETPTI(<a class="code" href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a>-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>)-&gt;pqAttach;</div>
<div class="line"><a name="l05770"></a><span class="lineno"> 5770</span>&#160;    }</div>
<div class="line"><a name="l05771"></a><span class="lineno"> 5771</span>&#160; </div>
<div class="line"><a name="l05772"></a><span class="lineno"> 5772</span>&#160;    <span class="keywordflow">while</span> (TRUE) {</div>
<div class="line"><a name="l05773"></a><span class="lineno"> 5773</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05774"></a><span class="lineno"> 5774</span>&#160;<span class="comment">         * We need to leave the critical section in this code, so just</span></div>
<div class="line"><a name="l05775"></a><span class="lineno"> 5775</span>&#160;<span class="comment">         * find the next threadinfo to attach, then leave the loop before</span></div>
<div class="line"><a name="l05776"></a><span class="lineno"> 5776</span>&#160;<span class="comment">         * leaving the critical section.</span></div>
<div class="line"><a name="l05777"></a><span class="lineno"> 5777</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05778"></a><span class="lineno"> 5778</span>&#160;        pHead = &amp;ptiCurrent-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">PtiList</a>;</div>
<div class="line"><a name="l05779"></a><span class="lineno"> 5779</span>&#160;        <span class="keywordflow">for</span> (pEntry = pHead-&gt;Flink; pEntry != pHead; pEntry = pEntry-&gt;Flink) {</div>
<div class="line"><a name="l05780"></a><span class="lineno"> 5780</span>&#160;            pti = CONTAINING_RECORD(pEntry, <a class="code" href="a02889.html">THREADINFO</a>, PtiLink);</div>
<div class="line"><a name="l05781"></a><span class="lineno"> 5781</span>&#160; </div>
<div class="line"><a name="l05782"></a><span class="lineno"> 5782</span>&#160;            <span class="keywordflow">if</span>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> == pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>) {</div>
<div class="line"><a name="l05783"></a><span class="lineno"> 5783</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> = NULL;</div>
<div class="line"><a name="l05784"></a><span class="lineno"> 5784</span>&#160;            }</div>
<div class="line"><a name="l05785"></a><span class="lineno"> 5785</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> != NULL) {</div>
<div class="line"><a name="l05786"></a><span class="lineno"> 5786</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05787"></a><span class="lineno"> 5787</span>&#160;            }</div>
<div class="line"><a name="l05788"></a><span class="lineno"> 5788</span>&#160; </div>
<div class="line"><a name="l05789"></a><span class="lineno"> 5789</span>&#160;        }</div>
<div class="line"><a name="l05790"></a><span class="lineno"> 5790</span>&#160; </div>
<div class="line"><a name="l05791"></a><span class="lineno"> 5791</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05792"></a><span class="lineno"> 5792</span>&#160;<span class="comment">         * If all threads have been attached, we&#39;re all done!</span></div>
<div class="line"><a name="l05793"></a><span class="lineno"> 5793</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05794"></a><span class="lineno"> 5794</span>&#160;        <span class="keywordflow">if</span> (pEntry == pHead)</div>
<div class="line"><a name="l05795"></a><span class="lineno"> 5795</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05796"></a><span class="lineno"> 5796</span>&#160; </div>
<div class="line"><a name="l05797"></a><span class="lineno"> 5797</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05798"></a><span class="lineno"> 5798</span>&#160;<span class="comment">         * It is crucial that we NULL out pqAttach for this queue once</span></div>
<div class="line"><a name="l05799"></a><span class="lineno"> 5799</span>&#160;<span class="comment">         * we have it in a local variable because the NULL-ness of this</span></div>
<div class="line"><a name="l05800"></a><span class="lineno"> 5800</span>&#160;<span class="comment">         * field is checked in attach operations.</span></div>
<div class="line"><a name="l05801"></a><span class="lineno"> 5801</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05802"></a><span class="lineno"> 5802</span>&#160;        pqAttach = pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>;</div>
<div class="line"><a name="l05803"></a><span class="lineno"> 5803</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> = NULL;</div>
<div class="line"><a name="l05804"></a><span class="lineno"> 5804</span>&#160; </div>
<div class="line"><a name="l05805"></a><span class="lineno"> 5805</span>&#160;        <a class="code" href="a03290.html#af3b07178c2d5c967a8b5656b3ebcab5e">AttachToQueue</a>(pti, pqAttach, pqJournal, pqForegroundNew == pqAttach);</div>
<div class="line"><a name="l05806"></a><span class="lineno"> 5806</span>&#160;    }</div>
<div class="line"><a name="l05807"></a><span class="lineno"> 5807</span>&#160; </div>
<div class="line"><a name="l05808"></a><span class="lineno"> 5808</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05809"></a><span class="lineno"> 5809</span>&#160;<span class="comment">     * If we are doing a journal detach, redistribute the input messages</span></div>
<div class="line"><a name="l05810"></a><span class="lineno"> 5810</span>&#160;<span class="comment">     * from the old queue.</span></div>
<div class="line"><a name="l05811"></a><span class="lineno"> 5811</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05812"></a><span class="lineno"> 5812</span>&#160;    <span class="keywordflow">if</span> (pqJournal != NULL) {</div>
<div class="line"><a name="l05813"></a><span class="lineno"> 5813</span>&#160;        <a class="code" href="a02857.html">PQMSG</a> pqmsgRedist;</div>
<div class="line"><a name="l05814"></a><span class="lineno"> 5814</span>&#160; </div>
<div class="line"><a name="l05815"></a><span class="lineno"> 5815</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqJournal-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l05816"></a><span class="lineno"> 5816</span>&#160;        (pqJournal-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)--;</div>
<div class="line"><a name="l05817"></a><span class="lineno"> 5817</span>&#160;        pqmsgRedist = pqJournal-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l05818"></a><span class="lineno"> 5818</span>&#160; </div>
<div class="line"><a name="l05819"></a><span class="lineno"> 5819</span>&#160;        pqJournal-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>      = NULL;</div>
<div class="line"><a name="l05820"></a><span class="lineno"> 5820</span>&#160;        pqJournal-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> = NULL;</div>
<div class="line"><a name="l05821"></a><span class="lineno"> 5821</span>&#160;        pqJournal-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>          = 0;</div>
<div class="line"><a name="l05822"></a><span class="lineno"> 5822</span>&#160;        <a class="code" href="a03290.html#aba92d10b804737271611397aecd11ac0">RedistributeInput</a>(pqmsgRedist, pqJournal);</div>
<div class="line"><a name="l05823"></a><span class="lineno"> 5823</span>&#160; </div>
<div class="line"><a name="l05824"></a><span class="lineno"> 5824</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05825"></a><span class="lineno"> 5825</span>&#160;<span class="comment">         * Only destroy the queue if it is no longer is use.</span></div>
<div class="line"><a name="l05826"></a><span class="lineno"> 5826</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05827"></a><span class="lineno"> 5827</span>&#160;        <span class="keywordflow">if</span> (pqJournal-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> == 0) {</div>
<div class="line"><a name="l05828"></a><span class="lineno"> 5828</span>&#160;            pqJournal-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> = 1;    <span class="comment">// prevent underflow</span></div>
<div class="line"><a name="l05829"></a><span class="lineno"> 5829</span>&#160;            <a class="code" href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a>(pqJournal, pti);</div>
<div class="line"><a name="l05830"></a><span class="lineno"> 5830</span>&#160;        }</div>
<div class="line"><a name="l05831"></a><span class="lineno"> 5831</span>&#160;    }</div>
<div class="line"><a name="l05832"></a><span class="lineno"> 5832</span>&#160; </div>
<div class="line"><a name="l05833"></a><span class="lineno"> 5833</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05834"></a><span class="lineno"> 5834</span>&#160;<span class="comment">     * If the current thread is not on the active desktop, do not</span></div>
<div class="line"><a name="l05835"></a><span class="lineno"> 5835</span>&#160;<span class="comment">     * change the global foreground state.</span></div>
<div class="line"><a name="l05836"></a><span class="lineno"> 5836</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05837"></a><span class="lineno"> 5837</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;rpdesk != <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>)</div>
<div class="line"><a name="l05838"></a><span class="lineno"> 5838</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l05839"></a><span class="lineno"> 5839</span>&#160; </div>
<div class="line"><a name="l05840"></a><span class="lineno"> 5840</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05841"></a><span class="lineno"> 5841</span>&#160;<span class="comment">     * We&#39;re done attaching. gptiForeground hasn&#39;t changed... but</span></div>
<div class="line"><a name="l05842"></a><span class="lineno"> 5842</span>&#160;<span class="comment">     * gpqForeground has!  Try not to leave NULL as the foreground.</span></div>
<div class="line"><a name="l05843"></a><span class="lineno"> 5843</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05844"></a><span class="lineno"> 5844</span>&#160;    <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> = pqForegroundNew;</div>
<div class="line"><a name="l05845"></a><span class="lineno"> 5845</span>&#160;    <a class="code" href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a> = pqForegroundPrevNew;</div>
<div class="line"><a name="l05846"></a><span class="lineno"> 5846</span>&#160; </div>
<div class="line"><a name="l05847"></a><span class="lineno"> 5847</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> == NULL) {</div>
<div class="line"><a name="l05848"></a><span class="lineno"> 5848</span>&#160;        <a class="code" href="a02581.html">PWND</a> pwndNewForeground;</div>
<div class="line"><a name="l05849"></a><span class="lineno"> 5849</span>&#160;        <a class="code" href="a02889.html">PTHREADINFO</a> pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l05850"></a><span class="lineno"> 5850</span>&#160; </div>
<div class="line"><a name="l05851"></a><span class="lineno"> 5851</span>&#160;        pwndNewForeground = <a class="code" href="a00890.html#a9c0a5a55ff2d3767bef82f98faebfd11">_GetNextQueueWindow</a>(pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>-&gt;<a class="code" href="a02581.html#a6171c9000ea2060597a9bcf498ee0316">spwndChild</a>, 0, FALSE);</div>
<div class="line"><a name="l05852"></a><span class="lineno"> 5852</span>&#160; </div>
<div class="line"><a name="l05853"></a><span class="lineno"> 5853</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05854"></a><span class="lineno"> 5854</span>&#160;<span class="comment">         * Don&#39;t use xxxSetForegroundWindow2 because we must not leave</span></div>
<div class="line"><a name="l05855"></a><span class="lineno"> 5855</span>&#160;<span class="comment">         * the critical section.  There is no currently active foreground</span></div>
<div class="line"><a name="l05856"></a><span class="lineno"> 5856</span>&#160;<span class="comment">         * so all that is needed is to post an activate event to the</span></div>
<div class="line"><a name="l05857"></a><span class="lineno"> 5857</span>&#160;<span class="comment">         * new foreground queue.</span></div>
<div class="line"><a name="l05858"></a><span class="lineno"> 5858</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05859"></a><span class="lineno"> 5859</span>&#160;        <span class="keywordflow">if</span> (pwndNewForeground != NULL) {</div>
<div class="line"><a name="l05860"></a><span class="lineno"> 5860</span>&#160;            <a class="code" href="a03290.html#aa573471dabf238131312c12fb896b945">PostEventMessage</a>(GETPTI(pwndNewForeground),</div>
<div class="line"><a name="l05861"></a><span class="lineno"> 5861</span>&#160;                    GETPTI(pwndNewForeground)-&gt;pq,QEVENT_ACTIVATE, NULL, 0,</div>
<div class="line"><a name="l05862"></a><span class="lineno"> 5862</span>&#160;                    0 , (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)HWq(pwndNewForeground));</div>
<div class="line"><a name="l05863"></a><span class="lineno"> 5863</span>&#160;        }</div>
<div class="line"><a name="l05864"></a><span class="lineno"> 5864</span>&#160;    }</div>
<div class="line"><a name="l05865"></a><span class="lineno"> 5865</span>&#160; </div>
<div class="line"><a name="l05866"></a><span class="lineno"> 5866</span>&#160;    <a class="code" href="a03290.html#a67abc9d7678097e0d7225e4af7f7973d">SetFMouseMoved</a>();</div>
<div class="line"><a name="l05867"></a><span class="lineno"> 5867</span>&#160; </div>
<div class="line"><a name="l05868"></a><span class="lineno"> 5868</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l05869"></a><span class="lineno"> 5869</span>&#160;}</div>
<div class="line"><a name="l05870"></a><span class="lineno"> 5870</span>&#160; </div>
<div class="line"><a name="l05871"></a><span class="lineno"><a class="line" href="a00899.html#a9eb8f3351ef77ddcac4a4f2a7375a1a2"> 5871</a></span>&#160;BOOL <a class="code" href="a03290.html#a9eb8f3351ef77ddcac4a4f2a7375a1a2">_AttachThreadInput</a>(</div>
<div class="line"><a name="l05872"></a><span class="lineno"> 5872</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiAttach,</div>
<div class="line"><a name="l05873"></a><span class="lineno"> 5873</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiAttachTo,</div>
<div class="line"><a name="l05874"></a><span class="lineno"> 5874</span>&#160;    BOOL fAttach)</div>
<div class="line"><a name="l05875"></a><span class="lineno"> 5875</span>&#160;{</div>
<div class="line"><a name="l05876"></a><span class="lineno"> 5876</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l05877"></a><span class="lineno"> 5877</span>&#160; </div>
<div class="line"><a name="l05878"></a><span class="lineno"> 5878</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05879"></a><span class="lineno"> 5879</span>&#160;<span class="comment">     * Attaching to yourself doesn&#39;t make any sense.</span></div>
<div class="line"><a name="l05880"></a><span class="lineno"> 5880</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05881"></a><span class="lineno"> 5881</span>&#160;    <span class="keywordflow">if</span> (ptiAttach == ptiAttachTo)</div>
<div class="line"><a name="l05882"></a><span class="lineno"> 5882</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l05883"></a><span class="lineno"> 5883</span>&#160; </div>
<div class="line"><a name="l05884"></a><span class="lineno"> 5884</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05885"></a><span class="lineno"> 5885</span>&#160;<span class="comment">     * Will this thread allow attaching? Shell threads and system threads</span></div>
<div class="line"><a name="l05886"></a><span class="lineno"> 5886</span>&#160;<span class="comment">     * won&#39;t allow attaching.</span></div>
<div class="line"><a name="l05887"></a><span class="lineno"> 5887</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05888"></a><span class="lineno"> 5888</span>&#160;    <span class="keywordflow">if</span> (ptiAttachTo-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DONTATTACHQUEUE)</div>
<div class="line"><a name="l05889"></a><span class="lineno"> 5889</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l05890"></a><span class="lineno"> 5890</span>&#160;    <span class="keywordflow">if</span> (ptiAttach-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DONTATTACHQUEUE)</div>
<div class="line"><a name="l05891"></a><span class="lineno"> 5891</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l05892"></a><span class="lineno"> 5892</span>&#160; </div>
<div class="line"><a name="l05893"></a><span class="lineno"> 5893</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05894"></a><span class="lineno"> 5894</span>&#160;<span class="comment">     * Don&#39;t allow attaching across desktops, either.</span></div>
<div class="line"><a name="l05895"></a><span class="lineno"> 5895</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05896"></a><span class="lineno"> 5896</span>&#160;    <span class="keywordflow">if</span> (ptiAttachTo-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> != ptiAttach-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>)</div>
<div class="line"><a name="l05897"></a><span class="lineno"> 5897</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l05898"></a><span class="lineno"> 5898</span>&#160; </div>
<div class="line"><a name="l05899"></a><span class="lineno"> 5899</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05900"></a><span class="lineno"> 5900</span>&#160;<span class="comment">     * If attaching, make a new attachinfo structure for this thread.</span></div>
<div class="line"><a name="l05901"></a><span class="lineno"> 5901</span>&#160;<span class="comment">     * If not attaching, remove an existing attach reference.</span></div>
<div class="line"><a name="l05902"></a><span class="lineno"> 5902</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05903"></a><span class="lineno"> 5903</span>&#160;    <span class="keywordflow">if</span> (fAttach) {</div>
<div class="line"><a name="l05904"></a><span class="lineno"> 5904</span>&#160;        <a class="code" href="a02873.html">PATTACHINFO</a> pai;</div>
<div class="line"><a name="l05905"></a><span class="lineno"> 5905</span>&#160; </div>
<div class="line"><a name="l05906"></a><span class="lineno"> 5906</span>&#160;         <span class="comment">/*</span></div>
<div class="line"><a name="l05907"></a><span class="lineno"> 5907</span>&#160;<span class="comment">         * Alloc a new attachinfo struct, fill it in, link it in.</span></div>
<div class="line"><a name="l05908"></a><span class="lineno"> 5908</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05909"></a><span class="lineno"> 5909</span>&#160;        <span class="keywordflow">if</span> ((pai = (<a class="code" href="a02873.html">PATTACHINFO</a>)UserAllocPool(<span class="keyword">sizeof</span>(<a class="code" href="a02873.html">ATTACHINFO</a>), TAG_ATTACHINFO)) == NULL)</div>
<div class="line"><a name="l05910"></a><span class="lineno"> 5910</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l05911"></a><span class="lineno"> 5911</span>&#160;        pai-&gt;<a class="code" href="a02873.html#a65c028a342cf68ac34f9334a0a35e98f">pti1</a> = ptiAttach;</div>
<div class="line"><a name="l05912"></a><span class="lineno"> 5912</span>&#160;        pai-&gt;<a class="code" href="a02873.html#a3c206203f1d50c21a63ae662ea9bdf48">pti2</a> = ptiAttachTo;;</div>
<div class="line"><a name="l05913"></a><span class="lineno"> 5913</span>&#160;        pai-&gt;<a class="code" href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">paiNext</a> = <a class="code" href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a>;</div>
<div class="line"><a name="l05914"></a><span class="lineno"> 5914</span>&#160;        <a class="code" href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a> = pai;</div>
<div class="line"><a name="l05915"></a><span class="lineno"> 5915</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05916"></a><span class="lineno"> 5916</span>&#160;        <a class="code" href="a02873.html">PATTACHINFO</a> *ppai;</div>
<div class="line"><a name="l05917"></a><span class="lineno"> 5917</span>&#160;        BOOL fFound = FALSE;</div>
<div class="line"><a name="l05918"></a><span class="lineno"> 5918</span>&#160; </div>
<div class="line"><a name="l05919"></a><span class="lineno"> 5919</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05920"></a><span class="lineno"> 5920</span>&#160;<span class="comment">         * Search for this attachinfo struct. If we can&#39;t find it, fail.</span></div>
<div class="line"><a name="l05921"></a><span class="lineno"> 5921</span>&#160;<span class="comment">         * If we do find it, unlink it and free it.</span></div>
<div class="line"><a name="l05922"></a><span class="lineno"> 5922</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05923"></a><span class="lineno"> 5923</span>&#160;        <span class="keywordflow">for</span> (ppai = &amp;<a class="code" href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a>; (*ppai) != NULL; ppai = &amp;(*ppai)-&gt;<a class="code" href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">paiNext</a>) {</div>
<div class="line"><a name="l05924"></a><span class="lineno"> 5924</span>&#160;            <span class="keywordflow">if</span> (((*ppai)-&gt;pti2 == ptiAttachTo) &amp;&amp; ((*ppai)-&gt;pti1 == ptiAttach)) {</div>
<div class="line"><a name="l05925"></a><span class="lineno"> 5925</span>&#160;                <a class="code" href="a02873.html">PATTACHINFO</a> paiKill = *ppai;</div>
<div class="line"><a name="l05926"></a><span class="lineno"> 5926</span>&#160;                fFound = TRUE;</div>
<div class="line"><a name="l05927"></a><span class="lineno"> 5927</span>&#160;                *ppai = (*ppai)-&gt;<a class="code" href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">paiNext</a>;</div>
<div class="line"><a name="l05928"></a><span class="lineno"> 5928</span>&#160;                UserFreePool((HLOCAL)paiKill);</div>
<div class="line"><a name="l05929"></a><span class="lineno"> 5929</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05930"></a><span class="lineno"> 5930</span>&#160;            }</div>
<div class="line"><a name="l05931"></a><span class="lineno"> 5931</span>&#160;        }</div>
<div class="line"><a name="l05932"></a><span class="lineno"> 5932</span>&#160; </div>
<div class="line"><a name="l05933"></a><span class="lineno"> 5933</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l05934"></a><span class="lineno"> 5934</span>&#160;<span class="comment">         * If we couldn&#39;t find this reference, then fail.</span></div>
<div class="line"><a name="l05935"></a><span class="lineno"> 5935</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l05936"></a><span class="lineno"> 5936</span>&#160;        <span class="keywordflow">if</span> (!fFound) {</div>
<div class="line"><a name="l05937"></a><span class="lineno"> 5937</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l05938"></a><span class="lineno"> 5938</span>&#160;        }</div>
<div class="line"><a name="l05939"></a><span class="lineno"> 5939</span>&#160;    }</div>
<div class="line"><a name="l05940"></a><span class="lineno"> 5940</span>&#160; </div>
<div class="line"><a name="l05941"></a><span class="lineno"> 5941</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l05942"></a><span class="lineno"> 5942</span>&#160;<span class="comment">     * Now do the actual reattachment work for all threads - unless we&#39;re</span></div>
<div class="line"><a name="l05943"></a><span class="lineno"> 5943</span>&#160;<span class="comment">     * journalling. If we did by mistake do attachment while journalling</span></div>
<div class="line"><a name="l05944"></a><span class="lineno"> 5944</span>&#160;<span class="comment">     * was occuring, journalling would be hosed because journalling requires</span></div>
<div class="line"><a name="l05945"></a><span class="lineno"> 5945</span>&#160;<span class="comment">     * all threads to be attached - but it is also treated as a special</span></div>
<div class="line"><a name="l05946"></a><span class="lineno"> 5946</span>&#160;<span class="comment">     * case so it doesn&#39;t affect the ATTACHINFO structures. Therefore</span></div>
<div class="line"><a name="l05947"></a><span class="lineno"> 5947</span>&#160;<span class="comment">     * recalcing attach info based on ATTACHINFO structures would break</span></div>
<div class="line"><a name="l05948"></a><span class="lineno"> 5948</span>&#160;<span class="comment">     * the attachment required for journalling.</span></div>
<div class="line"><a name="l05949"></a><span class="lineno"> 5949</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l05950"></a><span class="lineno"> 5950</span>&#160;    <span class="keywordflow">if</span> (!FJOURNALRECORD() &amp;&amp; !FJOURNALPLAYBACK())</div>
<div class="line"><a name="l05951"></a><span class="lineno"> 5951</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a03290.html#a555a50540fc3e5009b8d9262e0702592">ReattachThreads</a>(FALSE);</div>
<div class="line"><a name="l05952"></a><span class="lineno"> 5952</span>&#160; </div>
<div class="line"><a name="l05953"></a><span class="lineno"> 5953</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l05954"></a><span class="lineno"> 5954</span>&#160;}</div>
<div class="line"><a name="l05955"></a><span class="lineno"> 5955</span>&#160; </div>
<div class="line"><a name="l05956"></a><span class="lineno"> 5956</span>&#160; </div>
<div class="line"><a name="l05963"></a><span class="lineno"><a class="line" href="a00899.html#aed6cbec42b87882a902e274092e9e4cb"> 5963</a></span>&#160;LONG <a class="code" href="a03290.html#ab210d21bac44bbe95c4e8e80670f389b">_SetMessageExtraInfo</a>(LONG lData)</div>
<div class="line"><a name="l05964"></a><span class="lineno"> 5964</span>&#160;{</div>
<div class="line"><a name="l05965"></a><span class="lineno"> 5965</span>&#160;    LONG lRet;</div>
<div class="line"><a name="l05966"></a><span class="lineno"> 5966</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l05967"></a><span class="lineno"> 5967</span>&#160; </div>
<div class="line"><a name="l05968"></a><span class="lineno"> 5968</span>&#160;    lRet = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>;</div>
<div class="line"><a name="l05969"></a><span class="lineno"> 5969</span>&#160;    pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a> = lData;</div>
<div class="line"><a name="l05970"></a><span class="lineno"> 5970</span>&#160;    <span class="keywordflow">return</span> lRet;</div>
<div class="line"><a name="l05971"></a><span class="lineno"> 5971</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa02889_html_a63f9a7301bdb8da51c5180336650f449"><div class="ttname"><a href="a02889.html#a63f9a7301bdb8da51c5180336650f449">tagTHREADINFO::timeLast</a></div><div class="ttdeci">LONG timeLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02302">userk.h:2302</a></div></div>
<div class="ttc" id="aa00377_html_af1128a676756d86f949094178c96d93b"><div class="ttname"><a href="a00377.html#af1128a676756d86f949094178c96d93b">key</a></div><div class="ttdeci">an extra at the end is a dead key</div><div class="ttdef"><b>Definition:</b> <a href="a00377_source.html#l00016">kbdbe.txt:16</a></div></div>
<div class="ttc" id="aa02649_html_a1fc053b04d0e037452d1efb7426bd89c"><div class="ttname"><a href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">tagCLIENTTHREADINFO::fsWakeBits</a></div><div class="ttdeci">WORD fsWakeBits</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02218">user.h:2218</a></div></div>
<div class="ttc" id="aa03257_html_a888092e560f7a0919213285de1407193"><div class="ttname"><a href="a03257.html#a888092e560f7a0919213285de1407193">gdtMouseHover</a></div><div class="ttdeci">UINT gdtMouseHover</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00500">kernel/globals.c:500</a></div></div>
<div class="ttc" id="aa02889_html_ae8b869ec5b101646649020f5b0fd5d0d"><div class="ttname"><a href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">tagTHREADINFO::TIF_flags</a></div><div class="ttdeci">DWORD TIF_flags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02294">userk.h:2294</a></div></div>
<div class="ttc" id="aa02873_html"><div class="ttname"><a href="a02873.html">tagATTACHINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02204">userk.h:2204</a></div></div>
<div class="ttc" id="aa03290_html_a1788c133e88b438738af33ef258ffb78"><div class="ttname"><a href="a03290.html#a1788c133e88b438738af33ef258ffb78">QueryTrackMouseEvent</a></div><div class="ttdeci">BOOL QueryTrackMouseEvent(LPTRACKMOUSEEVENT lpTME)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02567">kernel/input.c:2567</a></div></div>
<div class="ttc" id="aa00899_html_a1e8f3de1ac479af792360b59a0a80bc7"><div class="ttname"><a href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a></div><div class="ttdeci">void CheckSysLock(int where, PQ pq, PTHREADINFO pti)</div></div>
<div class="ttc" id="aa03290_html_a0dee150599c13a9794347efe8e435f6f"><div class="ttname"><a href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a></div><div class="ttdeci">void FreeKeyState(PBYTE pKeyState)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01666">kernel/input.c:1666</a></div></div>
<div class="ttc" id="aa00371_html_a01c4659626880ba56745765a3580a36b"><div class="ttname"><a href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a></div><div class="ttdeci">#define RIPMSG0(flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00131">winerrp.h:131</a></div></div>
<div class="ttc" id="aa02869_html_a63df655cf92843da82e0c872b65baef1"><div class="ttname"><a href="a02869.html#a63df655cf92843da82e0c872b65baef1">tagQ::cThreads</a></div><div class="ttdeci">USHORT cThreads</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02189">userk.h:2189</a></div></div>
<div class="ttc" id="aa03290_html_a88031672cdc9e5f4f92f03caf1f65c81"><div class="ttname"><a href="a03290.html#a88031672cdc9e5f4f92f03caf1f65c81">MA_REHITTEST</a></div><div class="ttdeci">#define MA_REHITTEST</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01996">kernel/input.c:1996</a></div></div>
<div class="ttc" id="aa02865_html_a2e8d29c336ad6665d4f0657648582ae5"><div class="ttname"><a href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">tagMLIST::pqmsgWriteLast</a></div><div class="ttdeci">PQMSG pqmsgWriteLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02149">userk.h:2149</a></div></div>
<div class="ttc" id="aa03290_html_af3b07178c2d5c967a8b5656b3ebcab5e"><div class="ttname"><a href="a03290.html#af3b07178c2d5c967a8b5656b3ebcab5e">AttachToQueue</a></div><div class="ttdeci">void AttachToQueue(PTHREADINFO pti, PQ pqAttach, PQ pqJournal, BOOL fJoiningForeground)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05493">kernel/input.c:5493</a></div></div>
<div class="ttc" id="aa03257_html_a4a4dfda0c85b4e4ad2c10cb1f370df74"><div class="ttname"><a href="a03257.html#a4a4dfda0c85b4e4ad2c10cb1f370df74">gcyMouseHover</a></div><div class="ttdeci">UINT gcyMouseHover</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00499">kernel/globals.c:499</a></div></div>
<div class="ttc" id="aa02477_html_a3c509629a36511ee0d17273de6b9d6af"><div class="ttname"><a href="a02477.html#a3c509629a36511ee0d17273de6b9d6af">_CLIENTINFO::dwTIFlags</a></div><div class="ttdeci">DWORD dwTIFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00378">user.h:378</a></div></div>
<div class="ttc" id="aa02889_html_a7f41a9bbcd2f30304020b54827564df4"><div class="ttname"><a href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">tagTHREADINFO::pMenuState</a></div><div class="ttdeci">PMENUSTATE pMenuState</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02312">userk.h:2312</a></div></div>
<div class="ttc" id="aa00365_html_a3817ddad535f05817212be6d68e976bf"><div class="ttname"><a href="a00365.html#a3817ddad535f05817212be6d68e976bf">WNDENUMPROC_PWND</a></div><div class="ttdeci">BOOL(APIENTRY * WNDENUMPROC_PWND)(PWND, LPARAM)</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00769">user.h:769</a></div></div>
<div class="ttc" id="aa02873_html_a23f4b2005ab46e384ad14699e7a6eff7"><div class="ttname"><a href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">tagATTACHINFO::paiNext</a></div><div class="ttdeci">struct tagATTACHINFO * paiNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02205">userk.h:2205</a></div></div>
<div class="ttc" id="aa02869_html_ab38e745019cf5314eea3e78229d367c3"><div class="ttname"><a href="a02869.html#ab38e745019cf5314eea3e78229d367c3">tagQ::ptiMouse</a></div><div class="ttdeci">PTHREADINFO ptiMouse</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02163">userk.h:2163</a></div></div>
<div class="ttc" id="aa00881_html_ae11878514dabd4ba1a2c58dd2bcf2d4d"><div class="ttname"><a href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a></div><div class="ttdeci">BOOL xxxSleepTask(BOOL fInputIdle, HANDLE hEvent)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00234">taskman.c:234</a></div></div>
<div class="ttc" id="aa03257_html_a03e1a78fe19125d5809a8e6ecd22294d"><div class="ttname"><a href="a03257.html#a03e1a78fe19125d5809a8e6ecd22294d">dwMouseMoveExtraInfo</a></div><div class="ttdeci">DWORD dwMouseMoveExtraInfo</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00261">kernel/globals.c:261</a></div></div>
<div class="ttc" id="aa03290_html_a90c4d585a217d2ad963fa4eaa745536e"><div class="ttname"><a href="a03290.html#a90c4d585a217d2ad963fa4eaa745536e">CheckTransferState</a></div><div class="ttdeci">DWORD CheckTransferState(PTHREADINFO pti, PQ pqAttach, LONG offset, BOOL fJoiningForeground)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05443">kernel/input.c:5443</a></div></div>
<div class="ttc" id="aa02869_html_a93898ca4e261db30e33fcebd6b74cd0a"><div class="ttname"><a href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">tagQ::spwndLastMouseMessage</a></div><div class="ttdeci">PWND spwndLastMouseMessage</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02196">userk.h:2196</a></div></div>
<div class="ttc" id="aa00899_html_aa2b52134e7cd2fc791c9920e4a8d89bb"><div class="ttname"><a href="a00899.html#aa2b52134e7cd2fc791c9920e4a8d89bb">SpeedHitTest</a></div><div class="ttdeci">PWND SpeedHitTest(PWND pwndParent, POINT pt)</div><div class="ttdef"><b>Definition:</b> <a href="a00923_source.html#l00117">winwhere.c:117</a></div></div>
<div class="ttc" id="aa02869_html_a50df387cc5ba51033fb9e767c430f72f"><div class="ttname"><a href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">tagQ::spwndCapture</a></div><div class="ttdeci">PWND spwndCapture</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02166">userk.h:2166</a></div></div>
<div class="ttc" id="aa00875_html_a71623c9cb9e2b5c70fbb4235c6bb4b53"><div class="ttname"><a href="a00875.html#a71623c9cb9e2b5c70fbb4235c6bb4b53">StartScreenSaver</a></div><div class="ttdeci">void StartScreenSaver()</div><div class="ttdef"><b>Definition:</b> <a href="a00875_source.html#l00170">syscmd.c:170</a></div></div>
<div class="ttc" id="aa02865_html"><div class="ttname"><a href="a02865.html">tagMLIST</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02147">userk.h:2147</a></div></div>
<div class="ttc" id="aa03290_html_ae67dbba779f94ec0d718ab4596368c53"><div class="ttname"><a href="a03290.html#ae67dbba779f94ec0d718ab4596368c53">CTS_DONOTHING</a></div><div class="ttdeci">#define CTS_DONOTHING</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05439">kernel/input.c:5439</a></div></div>
<div class="ttc" id="aa00899_html_aa30d021e5e9cd423102a8ff2b7087f89"><div class="ttname"><a href="a00899.html#aa30d021e5e9cd423102a8ff2b7087f89">xxxImmProcessKey</a></div><div class="ttdeci">DWORD xxxImmProcessKey(IN PQ pq, IN PWND pwnd, IN UINT message, IN UINT wParam, IN LONG lParam)</div></div>
<div class="ttc" id="aa02869_html_a950fb049dd2c207bcda1f2a2c3912cc9"><div class="ttname"><a href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">tagQ::spwndActivePrev</a></div><div class="ttdeci">PWND spwndActivePrev</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02169">userk.h:2169</a></div></div>
<div class="ttc" id="aa02889_html_a66a4fa1d0ee4c5d1b6d84a91a73a3f9f"><div class="ttname"><a href="a02889.html#a66a4fa1d0ee4c5d1b6d84a91a73a3f9f">tagTHREADINFO::fsReserveKeys</a></div><div class="ttdeci">DWORD fsReserveKeys</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02331">userk.h:2331</a></div></div>
<div class="ttc" id="aa02581_html_a9ac6b15978318e3401ef9a878ccb40ac"><div class="ttname"><a href="a02581.html#a9ac6b15978318e3401ef9a878ccb40ac">tagWND::pcls</a></div><div class="ttdeci">PCLS pcls</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01403">user.h:1403</a></div></div>
<div class="ttc" id="aa00824_html_a7a7fb081b27165c43974d89be67bbad8"><div class="ttname"><a href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a></div><div class="ttdeci">VOID SetWakeBit(PTHREADINFO pti, UINT wWakeBit)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03276">queue.c:3276</a></div></div>
<div class="ttc" id="aa00686_html_a4252e9b246034444b0cdd9eb3474b432"><div class="ttname"><a href="a00686.html#a4252e9b246034444b0cdd9eb3474b432">xxxActivateApp</a></div><div class="ttdeci">BOOL xxxActivateApp(PWND pwnd, AAS *paas)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l00310">focusact.c:310</a></div></div>
<div class="ttc" id="aa03290_html_aa6ce87df873d5f9f1383eac7a3a8267d"><div class="ttname"><a href="a03290.html#aa6ce87df873d5f9f1383eac7a3a8267d">IdleTimerProc</a></div><div class="ttdeci">VOID IdleTimerProc(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l04859">kernel/input.c:4859</a></div></div>
<div class="ttc" id="aa02837_html_a472df270c88db7755093cd3ca1d1dee6"><div class="ttname"><a href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">tagPOPUPMENU::spwndNotify</a></div><div class="ttdeci">struct tagWND * spwndNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01936">userk.h:1936</a></div></div>
<div class="ttc" id="aa03290_html_a7bb16e9d18954c3ef50ae8bc75f89c5d"><div class="ttname"><a href="a03290.html#a7bb16e9d18954c3ef50ae8bc75f89c5d">_PostThreadMessage</a></div><div class="ttdeci">BOOL _PostThreadMessage(PTHREADINFO pti, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01064">kernel/input.c:1064</a></div></div>
<div class="ttc" id="aa00899_html_ae451a2dc8791c420d7c956a63adc33ba"><div class="ttname"><a href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a></div><div class="ttdeci">VOID EnterCrit(VOID)</div></div>
<div class="ttc" id="aa02869_html_a0ab106d34ad5aa9c1fdcd2eba652623e"><div class="ttname"><a href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">tagQ::mlInput</a></div><div class="ttdeci">MLIST mlInput</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02157">userk.h:2157</a></div></div>
<div class="ttc" id="aa02873_html_a3c206203f1d50c21a63ae662ea9bdf48"><div class="ttname"><a href="a02873.html#a3c206203f1d50c21a63ae662ea9bdf48">tagATTACHINFO::pti2</a></div><div class="ttdeci">PTHREADINFO pti2</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02207">userk.h:2207</a></div></div>
<div class="ttc" id="aa02757_html_ae5d494d4bc4e4a8a1181eefa82b37b5d"><div class="ttname"><a href="a02757.html#ae5d494d4bc4e4a8a1181eefa82b37b5d">tagAAS::fActivating</a></div><div class="ttdeci">UINT fActivating</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01477">userk.h:1477</a></div></div>
<div class="ttc" id="aa03263_html_ab55bcf13c45e6055491901b6617a930c"><div class="ttname"><a href="a03263.html#ab55bcf13c45e6055491901b6617a930c">gapfnScSendMessage</a></div><div class="ttdeci">CONST CFNSCSENDMESSAGE gapfnScSendMessage[]</div><div class="ttdef"><b>Definition:</b> <a href="a00350_source.html#l00016">messages.h:16</a></div></div>
<div class="ttc" id="aa02869_html_a47cf05ff40a81ae529300bef68e731d5"><div class="ttname"><a href="a02869.html#a47cf05ff40a81ae529300bef68e731d5">tagQ::rcDblClk</a></div><div class="ttdeci">RECT rcDblClk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02175">userk.h:2175</a></div></div>
<div class="ttc" id="aa00899_html_af22598950c2f41d596373168bd1e15ef"><div class="ttname"><a href="a00899.html#af22598950c2f41d596373168bd1e15ef">IsInsideMenuLoop</a></div><div class="ttdeci">__inline BOOL IsInsideMenuLoop(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l03517">userk.h:3517</a></div></div>
<div class="ttc" id="aa03290_html_a3c7a65a04f65f7c71626a1cca090a475"><div class="ttname"><a href="a03290.html#a3c7a65a04f65f7c71626a1cca090a475">PostUpdateKeyStateEvent</a></div><div class="ttdeci">void PostUpdateKeyStateEvent(PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01728">kernel/input.c:1728</a></div></div>
<div class="ttc" id="aa02905_html_a78173b879891f55834e4c01a7193e359"><div class="ttname"><a href="a02905.html#a78173b879891f55834e4c01a7193e359">tagPROCESSINFO::ptiMainThread</a></div><div class="ttdeci">PTHREADINFO ptiMainThread</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02390">userk.h:2390</a></div></div>
<div class="ttc" id="aa03290_html_a389031a6d28f2691dd911f121ef30e94"><div class="ttname"><a href="a03290.html#a389031a6d28f2691dd911f121ef30e94">xxxDispatchMessage</a></div><div class="ttdeci">LONG xxxDispatchMessage(LPMSG pmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00702">kernel/input.c:702</a></div></div>
<div class="ttc" id="aa03290_html_a98458d5f8be030de82ee292c023bb341"><div class="ttname"><a href="a03290.html#a98458d5f8be030de82ee292c023bb341">MouseEnter</a></div><div class="ttdeci">void MouseEnter(PQ pq, PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02515">kernel/input.c:2515</a></div></div>
<div class="ttc" id="aa02649_html_a2fa9e5ed0186fa6f16c046d47f736ef2"><div class="ttname"><a href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">tagCLIENTTHREADINFO::fsChangeBits</a></div><div class="ttdeci">WORD fsChangeBits</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02217">user.h:2217</a></div></div>
<div class="ttc" id="aa00737_html_a9a296006325773dbd9cc92a586007c34"><div class="ttname"><a href="a00737.html#a9a296006325773dbd9cc92a586007c34">xxxDoSysExpunge</a></div><div class="ttdeci">VOID xxxDoSysExpunge(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00737_source.html#l00252">libmgmt.c:252</a></div></div>
<div class="ttc" id="aa00365_html_a541a4d80afc3abe77692be2160e0f354"><div class="ttname"><a href="a00365.html#a541a4d80afc3abe77692be2160e0f354">RtlWCSMessageWParamCharToMB</a></div><div class="ttdeci">BOOL RtlWCSMessageWParamCharToMB(DWORD msg, PDWORD pWParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00932_source.html#l00323">chartran.c:323</a></div></div>
<div class="ttc" id="aa02857_html_ac13bc459ae800248eabb652b9f6dc8ed"><div class="ttname"><a href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">tagQMSG::msg</a></div><div class="ttdeci">MSG msg</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02051">userk.h:2051</a></div></div>
<div class="ttc" id="aa00890_html_a9c0a5a55ff2d3767bef82f98faebfd11"><div class="ttname"><a href="a00890.html#a9c0a5a55ff2d3767bef82f98faebfd11">_GetNextQueueWindow</a></div><div class="ttdeci">PWND _GetNextQueueWindow(PWND pwnd, BOOL fPrev, BOOL fAltEsc)</div><div class="ttdef"><b>Definition:</b> <a href="a00890_source.html#l00099">tmswitch.c:99</a></div></div>
<div class="ttc" id="aa03257_html_ad846449b20bf30ca2a61fb9a236cbfd1"><div class="ttname"><a href="a03257.html#ad846449b20bf30ca2a61fb9a236cbfd1">dtDblClk</a></div><div class="ttdeci">UINT dtDblClk</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00488">kernel/globals.c:488</a></div></div>
<div class="ttc" id="aa00674_html_a81a2552e2ea04adc0457e7e4649b1cc8"><div class="ttname"><a href="a00674.html#a81a2552e2ea04adc0457e7e4649b1cc8">xxxInternalEnumWindow</a></div><div class="ttdeci">BOOL xxxInternalEnumWindow(PWND pwndNext, WNDENUMPROC_PWND lpfn, LONG lParam, UINT flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00674_source.html#l00036">enumwin.c:36</a></div></div>
<div class="ttc" id="aa02757_html_a612c8d0305d93a525da7ab198f1bdf0b"><div class="ttname"><a href="a02757.html#a612c8d0305d93a525da7ab198f1bdf0b">tagAAS::ptiNotify</a></div><div class="ttdeci">PTHREADINFO ptiNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01475">userk.h:1475</a></div></div>
<div class="ttc" id="aa00365_html_a1a2ef1c363aa0787a8f8a7dde2a34aaf"><div class="ttname"><a href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a></div><div class="ttdeci">struct tagWND * PWND</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00059">user.h:59</a></div></div>
<div class="ttc" id="aa00638_html_a9f0bf38c04ea2aeebbf17e5f1353ea34"><div class="ttname"><a href="a00638.html#a9f0bf38c04ea2aeebbf17e5f1353ea34">UpdateCursorImage</a></div><div class="ttdeci">VOID UpdateCursorImage(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00483">cursor.c:483</a></div></div>
<div class="ttc" id="aa00881_html_a16f932bda409a22bfb319067daffc1a1"><div class="ttname"><a href="a00881.html#a16f932bda409a22bfb319067daffc1a1">xxxDirectedYield</a></div><div class="ttdeci">void xxxDirectedYield(DWORD dwThreadId)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00672">taskman.c:672</a></div></div>
<div class="ttc" id="aa00371_html_ad6b24a3d61abdc148c8751b5c5add686"><div class="ttname"><a href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a></div><div class="ttdeci">#define RIP_VERBOSE</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00030">winerrp.h:30</a></div></div>
<div class="ttc" id="aa03290_html_a9c2a89c84dc8211a1e69f10e5a271ddd"><div class="ttname"><a href="a03290.html#a9c2a89c84dc8211a1e69f10e5a271ddd">PQMSG_PLAYBACK</a></div><div class="ttdeci">#define PQMSG_PLAYBACK</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00109">kernel/input.c:109</a></div></div>
<div class="ttc" id="aa03290_html_a6ab75260f3779ea78a0a067bd3ce0024"><div class="ttname"><a href="a03290.html#a6ab75260f3779ea78a0a067bd3ce0024">CTS_CANCELOLD</a></div><div class="ttdeci">#define CTS_CANCELOLD</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05440">kernel/input.c:5440</a></div></div>
<div class="ttc" id="aa02801_html_a76d4881aa4c15330103e83a80e6b5dc7"><div class="ttname"><a href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">tagDESKTOP::pDeskInfo</a></div><div class="ttdeci">PDESKTOPINFO pDeskInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01706">userk.h:1706</a></div></div>
<div class="ttc" id="aa03290_html_a673f9d872c88727c8dd0c627382981f5"><div class="ttname"><a href="a03290.html#a673f9d872c88727c8dd0c627382981f5">RecalcThreadAttachment</a></div><div class="ttdeci">void RecalcThreadAttachment()</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05110">kernel/input.c:5110</a></div></div>
<div class="ttc" id="aa00824_html_ac708496b23f104c90d93744009fc5037"><div class="ttname"><a href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a></div><div class="ttdeci">VOID ClearWakeBit(PTHREADINFO pti, UINT wWakeBit, BOOL fSysCheck)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03390">queue.c:3390</a></div></div>
<div class="ttc" id="aa00365_html_ad3dfd3ee6ed128bf06b47ca3d67c652b"><div class="ttname"><a href="a00365.html#ad3dfd3ee6ed128bf06b47ca3d67c652b">PQMSG</a></div><div class="ttdeci">struct tagQMSG * PQMSG</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00058">user.h:58</a></div></div>
<div class="ttc" id="aa00935_html_a479bbe69c871894f6ca23dfa237481ad"><div class="ttname"><a href="a00935.html#a479bbe69c871894f6ca23dfa237481ad">SetRect</a></div><div class="ttdeci">BOOL APIENTRY SetRect(LPRECT prc, int left, int top, int right, int bottom)</div><div class="ttdef"><b>Definition:</b> <a href="a00935_source.html#l00021">rect.c:21</a></div></div>
<div class="ttc" id="aa03257_html_aaa5057517c2d0fcd47d29d0ab50cc111"><div class="ttname"><a href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a></div><div class="ttdeci">PQ gpqForegroundPrev</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00134">kernel/globals.c:134</a></div></div>
<div class="ttc" id="aa03257_html_ac33ef58925731203e45c9e6e6932c198"><div class="ttname"><a href="a03257.html#ac33ef58925731203e45c9e6e6932c198">cLangToggleKeys</a></div><div class="ttdeci">DWORD cLangToggleKeys</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00223">kernel/globals.c:223</a></div></div>
<div class="ttc" id="aa02889_html_a4f153f70a2bf0f73f46977b3401a7b7b"><div class="ttname"><a href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">tagTHREADINFO::pqAttach</a></div><div class="ttdeci">struct tagQ * pqAttach</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02327">userk.h:2327</a></div></div>
<div class="ttc" id="aa02869_html_a2b01f3f47a105e7bf6f6196ba5673926"><div class="ttname"><a href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">tagQ::QF_flags</a></div><div class="ttdeci">DWORD QF_flags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02187">userk.h:2187</a></div></div>
<div class="ttc" id="aa03290_html_a7fc47e841aed29a1a3b7e99816f3f1c1"><div class="ttname"><a href="a03290.html#a7fc47e841aed29a1a3b7e99816f3f1c1">CancelMouseHover</a></div><div class="ttdeci">void CancelMouseHover(PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02497">kernel/input.c:2497</a></div></div>
<div class="ttc" id="aa03290_html_aba92d10b804737271611397aecd11ac0"><div class="ttname"><a href="a03290.html#aba92d10b804737271611397aecd11ac0">RedistributeInput</a></div><div class="ttdeci">void RedistributeInput(PQMSG pqmsgS, PQ pqRedist)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05165">kernel/input.c:5165</a></div></div>
<div class="ttc" id="aa03290_html_a41bf5ee671d1979f26435f9c5e6eb7c3"><div class="ttname"><a href="a03290.html#a41bf5ee671d1979f26435f9c5e6eb7c3">xxxReadPostMessage</a></div><div class="ttdeci">BOOL xxxReadPostMessage(PTHREADINFO pti, LPMSG lpMsg, PWND pwndFilter, UINT msgMin, UINT msgMax, BOOL fRemoveMsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02551">queue.c:2551</a></div></div>
<div class="ttc" id="aa03641_html_ab30158d9de22f52e0dbe98db97b94e62"><div class="ttname"><a href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a></div><div class="ttdeci">BOOL CheckPwndFilter(PWND pwnd, PWND pwndFilter)</div><div class="ttdef"><b>Definition:</b> <a href="a03641_source.html#l00100">kernel/random.c:100</a></div></div>
<div class="ttc" id="aa00824_html_a700c756867e191fed7d258edd7e3e536"><div class="ttname"><a href="a00824.html#a700c756867e191fed7d258edd7e3e536">TransferWakeBit</a></div><div class="ttdeci">void TransferWakeBit(PTHREADINFO pti, UINT message)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03339">queue.c:3339</a></div></div>
<div class="ttc" id="aa00365_html_a422181d432442f3ca223ed68ff5585fb"><div class="ttname"><a href="a00365.html#a422181d432442f3ca223ed68ff5585fb">RtlMBMessageWParamCharToWCS</a></div><div class="ttdeci">BOOL RtlMBMessageWParamCharToWCS(DWORD msg, PDWORD pWParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00932_source.html#l00442">chartran.c:442</a></div></div>
<div class="ttc" id="aa02801_html_a2e665ea3941bf02f8d89deaebca7b0e4"><div class="ttname"><a href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">tagDESKTOP::PtiList</a></div><div class="ttdeci">LIST_ENTRY PtiList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01726">userk.h:1726</a></div></div>
<div class="ttc" id="aa03290_html_a4fd10b4e664d465eb22efbf0e24c3ab6"><div class="ttname"><a href="a03290.html#a4fd10b4e664d465eb22efbf0e24c3ab6">UpdateKeyState</a></div><div class="ttdeci">void UpdateKeyState(PQ pq, UINT vk, BOOL fDown)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02790">kernel/input.c:2790</a></div></div>
<div class="ttc" id="aa00338_html_a80475b6dfa016b055a2db28e2a8ec467"><div class="ttname"><a href="a00338.html#a80475b6dfa016b055a2db28e2a8ec467">DO_POST</a></div><div class="ttdeci">#define DO_POST</div><div class="ttdef"><b>Definition:</b> <a href="a00338_source.html#l00063">ddetrack.h:63</a></div></div>
<div class="ttc" id="aa00686_html_ae73d0cb06f257cf26e31b93dd71029ef"><div class="ttname"><a href="a00686.html#ae73d0cb06f257cf26e31b93dd71029ef">xxxActivateWindow</a></div><div class="ttdeci">BOOL xxxActivateWindow(PWND pwnd, UINT cmd)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l01671">focusact.c:1671</a></div></div>
<div class="ttc" id="aa02981_html_a6b5e163b766b9dff9cbd7186d638c5cd"><div class="ttname"><a href="a02981.html#a6b5e163b766b9dff9cbd7186d638c5cd">tagTIMER::ptmrNext</a></div><div class="ttdeci">struct tagTIMER * ptmrNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02865">userk.h:2865</a></div></div>
<div class="ttc" id="aa00872_html_a641f4e16c75a445b125667f001e07535"><div class="ttname"><a href="a00872.html#a641f4e16c75a445b125667f001e07535">CalcForegroundInsertAfter</a></div><div class="ttdeci">PWND CalcForegroundInsertAfter(PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00872_source.html#l02994">swp.c:2994</a></div></div>
<div class="ttc" id="aa02873_html_a65c028a342cf68ac34f9334a0a35e98f"><div class="ttname"><a href="a02873.html#a65c028a342cf68ac34f9334a0a35e98f">tagATTACHINFO::pti1</a></div><div class="ttdeci">PTHREADINFO pti1</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02206">userk.h:2206</a></div></div>
<div class="ttc" id="aa00881_html_ac9a8269a485b30a2c5e5bce624f8430f"><div class="ttname"><a href="a00881.html#ac9a8269a485b30a2c5e5bce624f8430f">xxxUserYield</a></div><div class="ttdeci">BOOL xxxUserYield(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00518">taskman.c:518</a></div></div>
<div class="ttc" id="aa02889_html_a318c1d57c31936937fb02314df457e08"><div class="ttname"><a href="a02889.html#a318c1d57c31936937fb02314df457e08">tagTHREADINFO::ptiSibling</a></div><div class="ttdeci">struct tagTHREADINFO * ptiSibling</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02333">userk.h:2333</a></div></div>
<div class="ttc" id="aa00371_html_a162a73e20dfabca084a3ebb4581631a8"><div class="ttname"><a href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a></div><div class="ttdeci">#define UserAssert(exp)</div><div class="ttdef"><b>Definition:</b> <a href="a00950_source.html#l00117">usersrv.h:117</a></div></div>
<div class="ttc" id="aa03257_html_a25f03eea622def9f9059f147118d2dcb"><div class="ttname"><a href="a03257.html#a25f03eea622def9f9059f147118d2dcb">gspklBaseLayout</a></div><div class="ttdeci">PKL gspklBaseLayout</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00212">kernel/globals.c:212</a></div></div>
<div class="ttc" id="aa00638_html_a326162b93195122192df202ff2db430a"><div class="ttname"><a href="a00638.html#a326162b93195122192df202ff2db430a">_SetCursor</a></div><div class="ttdeci">PCURSOR _SetCursor(PCURSOR pcur)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00037">cursor.c:37</a></div></div>
<div class="ttc" id="aa02797_html_a91ec88444118f8013721fdd6141958ba"><div class="ttname"><a href="a02797.html#a91ec88444118f8013721fdd6141958ba">tagKBDLANGTOGGLE::iBitPosition</a></div><div class="ttdeci">int iBitPosition</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01680">userk.h:1680</a></div></div>
<div class="ttc" id="aa03629_html"><div class="ttname"><a href="a03629.html">precomp.h</a></div></div>
<div class="ttc" id="aa03290_html_ae9dbe0a05586078bb0d0bc5762533895"><div class="ttname"><a href="a03290.html#ae9dbe0a05586078bb0d0bc5762533895">xxxScanSysQueue</a></div><div class="ttdeci">BOOL xxxScanSysQueue(PTHREADINFO ptiCurrent, LPMSG lpMsg, PWND pwndFilter, UINT msgMinFilter, UINT msgMaxFilter, DWORD flags, DWORD fsReason)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l03275">kernel/input.c:3275</a></div></div>
<div class="ttc" id="aa00887_html_ae3b42fc45613df6ae1803075394c386a"><div class="ttname"><a href="a00887.html#ae3b42fc45613df6ae1803075394c386a">_KillSystemTimer</a></div><div class="ttdeci">BOOL _KillSystemTimer(PWND pwnd, UINT nIDEvent)</div><div class="ttdef"><b>Definition:</b> <a href="a00887_source.html#l00408">timers.c:408</a></div></div>
<div class="ttc" id="aa03290_html_a9b5ddf89b1538565c050cbdaa8527f82"><div class="ttname"><a href="a03290.html#a9b5ddf89b1538565c050cbdaa8527f82">MA_SKIP</a></div><div class="ttdeci">#define MA_SKIP</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01995">kernel/input.c:1995</a></div></div>
<div class="ttc" id="aa02869_html_a1a5a5450f389722e0685dd9da834bfbe"><div class="ttname"><a href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">tagQ::idSysPeek</a></div><div class="ttdeci">DWORD idSysPeek</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02161">userk.h:2161</a></div></div>
<div class="ttc" id="aa02889_html_af8fb3a0f2a65257b83edd457a19dca57"><div class="ttname"><a href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">tagTHREADINFO::ptdb</a></div><div class="ttdeci">PTDB ptdb</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02315">userk.h:2315</a></div></div>
<div class="ttc" id="aa02981_html_a09afb45dd2a93c45335dd85f35579301"><div class="ttname"><a href="a02981.html#a09afb45dd2a93c45335dd85f35579301">tagTIMER::pfn</a></div><div class="ttdeci">WNDPROC_PWND pfn</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02872">userk.h:2872</a></div></div>
<div class="ttc" id="aa00842_html_adb5204decd255d5005372b2c12890113"><div class="ttname"><a href="a00842.html#adb5204decd255d5005372b2c12890113">xxxBroadcastMessage</a></div><div class="ttdeci">LONG xxxBroadcastMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam, UINT wCmd, PBROADCASTMSG pbcm)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l02898">sendmsg.c:2898</a></div></div>
<div class="ttc" id="aa00842_html_a69cf2e14dcefd941469ad5126e40f79a"><div class="ttname"><a href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a></div><div class="ttdeci">LONG xxxSendMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l00613">sendmsg.c:613</a></div></div>
<div class="ttc" id="aa00257_html_a8315d2c807ba18ba9e528c40614b6173"><div class="ttname"><a href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a></div><div class="ttdeci">PTHREADINFO PtiCurrent(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00263_source.html#l00526">winmgrc.c:526</a></div></div>
<div class="ttc" id="aa02905_html_a2005bba2f650d045ed083841bfeb9648"><div class="ttname"><a href="a02905.html#a2005bba2f650d045ed083841bfeb9648">tagPROCESSINFO::dwhmodLibLoadedMask</a></div><div class="ttdeci">DWORD dwhmodLibLoadedMask</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02397">userk.h:2397</a></div></div>
<div class="ttc" id="aa02581_html_a5242d6e2f6cd000e8a85dcd824104ec4"><div class="ttname"><a href="a02581.html#a5242d6e2f6cd000e8a85dcd824104ec4">tagWND::strName</a></div><div class="ttdeci">LARGE_UNICODE_STRING strName</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01414">user.h:1414</a></div></div>
<div class="ttc" id="aa03290_html_a28131755e87cbf28a25b37ad577f0999"><div class="ttname"><a href="a03290.html#a28131755e87cbf28a25b37ad577f0999">CANCEL_ACTIVESTATE</a></div><div class="ttdeci">#define CANCEL_ACTIVESTATE</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00099">kernel/input.c:99</a></div></div>
<div class="ttc" id="aa00701_html_ae3ba25da64afb34641a42f7c163aded0"><div class="ttname"><a href="a00701.html#ae3ba25da64afb34641a42f7c163aded0">xxxCallJournalRecordHook</a></div><div class="ttdeci">void xxxCallJournalRecordHook(PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l01355">hooks.c:1355</a></div></div>
<div class="ttc" id="aa00338_html_ab6b030d454ca012e42ab1be328dd14a2"><div class="ttname"><a href="a00338.html#ab6b030d454ca012e42ab1be328dd14a2">FAKE_POST</a></div><div class="ttdeci">#define FAKE_POST</div><div class="ttdef"><b>Definition:</b> <a href="a00338_source.html#l00062">ddetrack.h:62</a></div></div>
<div class="ttc" id="aa02581_html_af729b7de7a8fb84b70b70c4b401ce789"><div class="ttname"><a href="a02581.html#af729b7de7a8fb84b70b70c4b401ce789">tagWND::spwndNext</a></div><div class="ttdeci">struct tagWND * spwndNext</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01391">user.h:1391</a></div></div>
<div class="ttc" id="aa03290_html_a50cffbba16c3bea57405e8726eb4b682"><div class="ttname"><a href="a03290.html#a50cffbba16c3bea57405e8726eb4b682">KeyStateLookasideZone</a></div><div class="ttdeci">ZONE_HEADER KeyStateLookasideZone</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00090">kernel/input.c:90</a></div></div>
<div class="ttc" id="aa03290_html_ab210d21bac44bbe95c4e8e80670f389b"><div class="ttname"><a href="a03290.html#ab210d21bac44bbe95c4e8e80670f389b">_SetMessageExtraInfo</a></div><div class="ttdeci">LONG _SetMessageExtraInfo(LONG lData)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05963">kernel/input.c:5963</a></div></div>
<div class="ttc" id="aa03290_html_a85b93c8ee73cb5dc4eb0e7b3221a454a"><div class="ttname"><a href="a03290.html#a85b93c8ee73cb5dc4eb0e7b3221a454a">ScreenSaverCheck</a></div><div class="ttdeci">void ScreenSaverCheck(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l03135">kernel/input.c:3135</a></div></div>
<div class="ttc" id="aa00365_html_aeb45e1c65bc6f45b9c278f43d805a86e"><div class="ttname"><a href="a00365.html#aeb45e1c65bc6f45b9c278f43d805a86e">WNDPROC_PWND</a></div><div class="ttdeci">LONG(APIENTRY * WNDPROC_PWND)(PWND, UINT, DWORD, LONG)</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00767">user.h:767</a></div></div>
<div class="ttc" id="aa02889_html_a215417492fadc11678c689da2447f02e"><div class="ttname"><a href="a02889.html#a215417492fadc11678c689da2447f02e">tagTHREADINFO::ppi</a></div><div class="ttdeci">struct tagPROCESSINFO * ppi</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02271">userk.h:2271</a></div></div>
<div class="ttc" id="aa00686_html_ac02cf9f8e2879a07c57e42ef8f4ff885"><div class="ttname"><a href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a></div><div class="ttdeci">VOID SetForegroundPriority(PTHREADINFO pti, BOOL fSetForeground)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l02174">focusact.c:2174</a></div></div>
<div class="ttc" id="aa03290_html_aa573471dabf238131312c12fb896b945"><div class="ttname"><a href="a03290.html#aa573471dabf238131312c12fb896b945">PostEventMessage</a></div><div class="ttdeci">BOOL PostEventMessage(PTHREADINFO pti, PQ pq, DWORD dwQEvent, PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01893">kernel/input.c:1893</a></div></div>
<div class="ttc" id="aa02869_html_a271f3bdd84cb32ef7ab8c919d19ae658"><div class="ttname"><a href="a02869.html#a271f3bdd84cb32ef7ab8c919d19ae658">tagQ::idSysLock</a></div><div class="ttdeci">DWORD idSysLock</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02160">userk.h:2160</a></div></div>
<div class="ttc" id="aa03290_html_aa9bd51ab0c0075e158ae221347d12557"><div class="ttname"><a href="a03290.html#aa9bd51ab0c0075e158ae221347d12557">AddAttachment</a></div><div class="ttdeci">void AddAttachment(PTHREADINFO pti, PQ pqAttach, LPBOOL pfChanged)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05015">kernel/input.c:5015</a></div></div>
<div class="ttc" id="aa03290_html_a4147dbf43a1943171ea44ffbb52c791d"><div class="ttname"><a href="a03290.html#a4147dbf43a1943171ea44ffbb52c791d">xxxActiveWindowTracking</a></div><div class="ttdeci">int xxxActiveWindowTracking(PWND pwnd, UINT uMsg, int iHitTest)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02005">kernel/input.c:2005</a></div></div>
<div class="ttc" id="aa02889_html_ad2b39e24db61b348a98aee43f81aac9c"><div class="ttname"><a href="a02889.html#ad2b39e24db61b348a98aee43f81aac9c">tagTHREADINFO::exitCode</a></div><div class="ttdeci">int exitCode</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02307">userk.h:2307</a></div></div>
<div class="ttc" id="aa03290_html_aee8a15810682e7c32aa770b466476b6f"><div class="ttname"><a href="a03290.html#aee8a15810682e7c32aa770b466476b6f">PATHTAKEN</a></div><div class="ttdeci">#define PATHTAKEN(x)</div></div>
<div class="ttc" id="aa02885_html_abfc93aac8825e9638c90a2fbb8bca855"><div class="ttname"><a href="a02885.html#abfc93aac8825e9638c90a2fbb8bca855">tagMENUSTATE::pGlobalPopupMenu</a></div><div class="ttdeci">PPOPUPMENU pGlobalPopupMenu</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02243">userk.h:2243</a></div></div>
<div class="ttc" id="aa00686_html_a16558717257c16a685cc2eaf97a67ad3"><div class="ttname"><a href="a00686.html#a16558717257c16a685cc2eaf97a67ad3">xxxSetForegroundWindow2</a></div><div class="ttdeci">BOOL xxxSetForegroundWindow2(PWND pwnd, PTHREADINFO pti, DWORD fFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l01045">focusact.c:1045</a></div></div>
<div class="ttc" id="aa00938_html_a2b7e151e7244f61923da5729bddc63cf"><div class="ttname"><a href="a00938.html#a2b7e151e7244f61923da5729bddc63cf">wsprintfA</a></div><div class="ttdeci">int WINAPIV wsprintfA(LPSTR lpOut, LPCSTR lpFmt,...)</div><div class="ttdef"><b>Definition:</b> <a href="a00938_source.html#l00515">wsprintf.c:515</a></div></div>
<div class="ttc" id="aa03290_html_ab7a8ea0145ef1df8bfb450d1ac6fed9e"><div class="ttname"><a href="a03290.html#ab7a8ea0145ef1df8bfb450d1ac6fed9e">ResetMouseTracking</a></div><div class="ttdeci">void ResetMouseTracking(PQ pq, PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02549">kernel/input.c:2549</a></div></div>
<div class="ttc" id="aa02869_html_a875fdfc42780d6ae1b2d7df4402afae1"><div class="ttname"><a href="a02869.html#a875fdfc42780d6ae1b2d7df4402afae1">tagQ::afKeyRecentDown</a></div><div class="ttdeci">BYTE afKeyRecentDown[CBKEYSTATERECENTDOWN]</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02177">userk.h:2177</a></div></div>
<div class="ttc" id="aa02609_html_a90cb8c3bf2c119d721de439c1e18733b"><div class="ttname"><a href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">tagDESKTOPINFO::asphkStart</a></div><div class="ttdeci">struct tagHOOK * asphkStart[CWINHOOKS]</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01605">user.h:1605</a></div></div>
<div class="ttc" id="aa03290_html_a6342e05d127c39d3e4639914749fc79f"><div class="ttname"><a href="a03290.html#a6342e05d127c39d3e4639914749fc79f">TrackMouseEvent</a></div><div class="ttdeci">BOOL TrackMouseEvent(LPTRACKMOUSEEVENT lpTME)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02608">kernel/input.c:2608</a></div></div>
<div class="ttc" id="aa03257_html_ad79c05a04d897d68910afd81af0c797d"><div class="ttname"><a href="a03257.html#ad79c05a04d897d68910afd81af0c797d">gcHotKey</a></div><div class="ttdeci">int gcHotKey</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00154">kernel/globals.c:154</a></div></div>
<div class="ttc" id="aa00371_html_ae61d954062a9ece52e350e54cad9a23d"><div class="ttname"><a href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a></div><div class="ttdeci">#define RIPERR0(idErr, flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00119">winerrp.h:119</a></div></div>
<div class="ttc" id="aa02477_html_a79413d59e46650132a5add64bfd87791"><div class="ttname"><a href="a02477.html#a79413d59e46650132a5add64bfd87791">_CLIENTINFO::cSpins</a></div><div class="ttdeci">DWORD cSpins</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00374">user.h:374</a></div></div>
<div class="ttc" id="aa02905_html_a8c47e61ad8490b0e1589fce16938e69f"><div class="ttname"><a href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">tagPROCESSINFO::cSysExpunge</a></div><div class="ttdeci">UINT cSysExpunge</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02396">userk.h:2396</a></div></div>
<div class="ttc" id="aa02581_html_a6be2d067ba15d4ec8cfc2e87922094f5"><div class="ttname"><a href="a02581.html#a6be2d067ba15d4ec8cfc2e87922094f5">tagWND::head</a></div><div class="ttdeci">THROBJHEAD head</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01389">user.h:1389</a></div></div>
<div class="ttc" id="aa00887_html_a29098a85ba39b7f172fc533c86ffd129"><div class="ttname"><a href="a00887.html#a29098a85ba39b7f172fc533c86ffd129">SetJournalTimer</a></div><div class="ttdeci">void SetJournalTimer(DWORD dt, UINT msgJournal)</div><div class="ttdef"><b>Definition:</b> <a href="a00887_source.html#l00664">timers.c:664</a></div></div>
<div class="ttc" id="aa00899_html_abfae1dfb48db23dcea4494f7990ad6a6"><div class="ttname"><a href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock</a></div><div class="ttdeci">VOID ThreadLock(PVOID pobj, PTL ptl)</div></div>
<div class="ttc" id="aa02905_html_a8dec25df4d4163bb209f9f8c1bc70d45"><div class="ttname"><a href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">tagPROCESSINFO::ptiList</a></div><div class="ttdeci">PTHREADINFO ptiList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02406">userk.h:2406</a></div></div>
<div class="ttc" id="aa03290_html_aa9a64bb53d41987d293b3a0df290b748"><div class="ttname"><a href="a03290.html#aa9a64bb53d41987d293b3a0df290b748">xxxWaitMessage</a></div><div class="ttdeci">BOOL xxxWaitMessage(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00129">kernel/input.c:129</a></div></div>
<div class="ttc" id="aa02869_html_a06d8cdda46761be0d0209f22f5396c50"><div class="ttname"><a href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">tagQ::ptiKeyboard</a></div><div class="ttdeci">PTHREADINFO ptiKeyboard</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02164">userk.h:2164</a></div></div>
<div class="ttc" id="aa03290_html_a3f5fcf81ee185d4981c54b9a7fbcf264"><div class="ttname"><a href="a03290.html#a3f5fcf81ee185d4981c54b9a7fbcf264">CANCEL_CAPTURESTATE</a></div><div class="ttdeci">#define CANCEL_CAPTURESTATE</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00101">kernel/input.c:101</a></div></div>
<div class="ttc" id="aa02877_html_afb9b6a62420feb835630dae9263ba014"><div class="ttname"><a href="a02877.html#afb9b6a62420feb835630dae9263ba014">tagWOWTHREADINFO::pIdleEvent</a></div><div class="ttdeci">PKEVENT pIdleEvent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02224">userk.h:2224</a></div></div>
<div class="ttc" id="aa03290_html_a199ef1fc7ecf82549845894f87e70e98"><div class="ttname"><a href="a03290.html#a199ef1fc7ecf82549845894f87e70e98">LangToggleKeyState</a></div><div class="ttdeci">int LangToggleKeyState</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00086">kernel/input.c:86</a></div></div>
<div class="ttc" id="aa00887_html_a23803d0eb05592a1e1ae26b60e68b420"><div class="ttname"><a href="a00887.html#a23803d0eb05592a1e1ae26b60e68b420">_SetSystemTimer</a></div><div class="ttdeci">UINT _SetSystemTimer(PWND pwnd, UINT nIDEvent, DWORD dwElapse, WNDPROC_PWND pTimerFunc)</div><div class="ttdef"><b>Definition:</b> <a href="a00887_source.html#l00078">timers.c:78</a></div></div>
<div class="ttc" id="aa03290_html_a35e4e68150e7c6714358e095e657bda6"><div class="ttname"><a href="a03290.html#a35e4e68150e7c6714358e095e657bda6">Recalc2</a></div><div class="ttdeci">void Recalc2(PQ pqAttach)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05044">kernel/input.c:5044</a></div></div>
<div class="ttc" id="aa00953_html_aebb9e13210d88d43e32e735ada43a425"><div class="ttname"><a href="a00953.html#aebb9e13210d88d43e32e735ada43a425">CHAR</a></div><div class="ttdeci">char CHAR</div><div class="ttdef"><b>Definition:</b> <a href="a00953_source.html#l00007">bench.c:7</a></div></div>
<div class="ttc" id="aa02609_html"><div class="ttname"><a href="a02609.html">tagDESKTOPINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01599">user.h:1599</a></div></div>
<div class="ttc" id="aa03290_html_ab4c48768df8f715f33021685ac680d99"><div class="ttname"><a href="a03290.html#ab4c48768df8f715f33021685ac680d99">DUMPPATHTAKEN</a></div><div class="ttdeci">#define DUMPPATHTAKEN()</div></div>
<div class="ttc" id="aa02889_html_af11214ca8a85a19dc241374ddc2d4824"><div class="ttname"><a href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">tagTHREADINFO::pClientInfo</a></div><div class="ttdeci">PCLIENTINFO pClientInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02292">userk.h:2292</a></div></div>
<div class="ttc" id="aa03257_html_a4c545d9814e49026b88914e087e66047"><div class="ttname"><a href="a03257.html#a4c545d9814e49026b88914e087e66047">LangToggle</a></div><div class="ttdeci">KBDLANGTOGGLE LangToggle[]</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00217">kernel/globals.c:217</a></div></div>
<div class="ttc" id="aa03257_html_a0358e1b51ee64a8ac724d12f71ab14a5"><div class="ttname"><a href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a></div><div class="ttdeci">PATTACHINFO gpai</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00044">kernel/globals.c:44</a></div></div>
<div class="ttc" id="aa03290_html_a1fd172260ffff663b17ed4d024cdcce7"><div class="ttname"><a href="a03290.html#a1fd172260ffff663b17ed4d024cdcce7">_PostQuitMessage</a></div><div class="ttdeci">BOOL _PostQuitMessage(int nExitCode)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01039">kernel/input.c:1039</a></div></div>
<div class="ttc" id="aa03257_html_abb2b4057bfd76cc925ae845dbb8c8390"><div class="ttname"><a href="a03257.html#abb2b4057bfd76cc925ae845dbb8c8390">gpdeskRecalcQueueAttach</a></div><div class="ttdeci">PDESKTOP gpdeskRecalcQueueAttach</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00059">kernel/globals.c:59</a></div></div>
<div class="ttc" id="aa02869_html_a72a2774228eff8f8a0c25ef4da8c8fee"><div class="ttname"><a href="a02869.html#a72a2774228eff8f8a0c25ef4da8c8fee">tagQ::rcMouseHover</a></div><div class="ttdeci">RECT rcMouseHover</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02197">userk.h:2197</a></div></div>
<div class="ttc" id="aa03257_html_a15b01bf3bf02ba131160e26e97f4abf5"><div class="ttname"><a href="a03257.html#a15b01bf3bf02ba131160e26e97f4abf5">gptiRit</a></div><div class="ttdeci">PTHREADINFO gptiRit</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00132">kernel/globals.c:132</a></div></div>
<div class="ttc" id="aa03290_html_a965b7101a952d947aed195405703c0d6"><div class="ttname"><a href="a03290.html#a965b7101a952d947aed195405703c0d6">MA_PASSTHRU</a></div><div class="ttdeci">#define MA_PASSTHRU</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01994">kernel/input.c:1994</a></div></div>
<div class="ttc" id="aa00935_html_a75b3bf802c369845c4381fcee638bc8a"><div class="ttname"><a href="a00935.html#a75b3bf802c369845c4381fcee638bc8a">PtInRect</a></div><div class="ttdeci">BOOL APIENTRY PtInRect(CONST RECT *prc, POINT pt)</div><div class="ttdef"><b>Definition:</b> <a href="a00935_source.html#l00111">rect.c:111</a></div></div>
<div class="ttc" id="aa03257_html_a2cff4327a97c844cd113c0dae7541390"><div class="ttname"><a href="a03257.html#a2cff4327a97c844cd113c0dae7541390">gspwndCursor</a></div><div class="ttdeci">PWND gspwndCursor</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00137">kernel/globals.c:137</a></div></div>
<div class="ttc" id="aa02889_html_a829d37a7e283dd742b6972604b7097ba"><div class="ttname"><a href="a02889.html#a829d37a7e283dd742b6972604b7097ba">tagTHREADINFO::cVisWindows</a></div><div class="ttdeci">UINT cVisWindows</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02325">userk.h:2325</a></div></div>
<div class="ttc" id="aa02869_html_a97845e5f321fb758821ac99bd53840de"><div class="ttname"><a href="a02869.html#a97845e5f321fb758821ac99bd53840de">tagQ::iCursorLevel</a></div><div class="ttdeci">int iCursorLevel</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02185">userk.h:2185</a></div></div>
<div class="ttc" id="aa03188_html_a6a4f1209e6b46089d96dfc7dc5eb5207"><div class="ttname"><a href="a03188.html#a6a4f1209e6b46089d96dfc7dc5eb5207">xxxDDETrackPostHook</a></div><div class="ttdeci">DWORD xxxDDETrackPostHook(PUINT pmessage, PWND pwndTo, WPARAM wParam, LPLONG plParam, BOOL fSent)</div><div class="ttdoc">xxxDDETrackPostHook</div><div class="ttdef"><b>Definition:</b> <a href="a03188_source.html#l00324">kernel/ddetrack.c:324</a></div></div>
<div class="ttc" id="aa00563_html_a074685e97e89d6aa2accdfcb82328699"><div class="ttname"><a href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a></div><div class="ttdeci">ddeml v[i&lt; inst &gt;][t&lt; type &gt;][hObj|pObj] Dump DDEML state information ddeml lists all ddeml instances for this process n ddeml t&lt; type &gt; lists all ddeml objects of the given type n n assumes link is first DWORD</div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00175">exts.h:175</a></div></div>
<div class="ttc" id="aa02865_html_adcf976c068271034e6e569ce3109eb07"><div class="ttname"><a href="a02865.html#adcf976c068271034e6e569ce3109eb07">tagMLIST::cMsgs</a></div><div class="ttdeci">DWORD cMsgs</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02150">userk.h:2150</a></div></div>
<div class="ttc" id="aa03257_html_a606776c14d11ee58302343e63e1cb890"><div class="ttname"><a href="a03257.html#a606776c14d11ee58302343e63e1cb890">timeLastInputMessage</a></div><div class="ttdeci">DWORD timeLastInputMessage</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00483">kernel/globals.c:483</a></div></div>
<div class="ttc" id="aa03290_html_a67abc9d7678097e0d7225e4af7f7973d"><div class="ttname"><a href="a03290.html#a67abc9d7678097e0d7225e4af7f7973d">SetFMouseMoved</a></div><div class="ttdeci">VOID SetFMouseMoved(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01213">kernel/input.c:1213</a></div></div>
<div class="ttc" id="aa03257_html_ab581288d85a9ba3563162af65596e427"><div class="ttname"><a href="a03257.html#ab581288d85a9ba3563162af65596e427">gspwndMouseOwner</a></div><div class="ttdeci">PWND gspwndMouseOwner</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00470">kernel/globals.c:470</a></div></div>
<div class="ttc" id="aa00731_html_a5a3f95ba0694746c5099aa1846b335c5"><div class="ttname"><a href="a00731.html#a5a3f95ba0694746c5099aa1846b335c5">_GetAsyncKeyState</a></div><div class="ttdeci">SHORT _GetAsyncKeyState(int vk)</div><div class="ttdef"><b>Definition:</b> <a href="a00731_source.html#l00086">keyboard.c:86</a></div></div>
<div class="ttc" id="aa00824_html_a44b46f3a89833f8c52a823637e5f5021"><div class="ttname"><a href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a></div><div class="ttdeci">PQ AllocQueue(PTHREADINFO ptiKeyState, PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01399">queue.c:1399</a></div></div>
<div class="ttc" id="aa00824_html_ae98d2a9cd72776c2a573809d347a8366"><div class="ttname"><a href="a00824.html#ae98d2a9cd72776c2a573809d347a8366">xxxProcessEventMessage</a></div><div class="ttdeci">VOID xxxProcessEventMessage(PTHREADINFO pti, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02682">queue.c:2682</a></div></div>
<div class="ttc" id="aa00899_html_ac7b632aec491adfba0ade3cd2eb6dca4"><div class="ttname"><a href="a00899.html#ac7b632aec491adfba0ade3cd2eb6dca4">xxxWindowHitTest</a></div><div class="ttdeci">HWND xxxWindowHitTest(PWND pwnd, POINT pt, int *pipos, BOOL fIgnoreDisabled)</div><div class="ttdef"><b>Definition:</b> <a href="a00923_source.html#l00179">winwhere.c:179</a></div></div>
<div class="ttc" id="aa01881_html"><div class="ttname"><a href="a01881.html">_TL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00257_source.html#l00347">usercli.h:347</a></div></div>
<div class="ttc" id="aa00887_html_a04a824f3f9528ea16629393ebda2bd6a"><div class="ttname"><a href="a00887.html#a04a824f3f9528ea16629393ebda2bd6a">DoTimer</a></div><div class="ttdeci">BOOL DoTimer(PWND pwndFilter, UINT wMsgFilterMin, UINT wMsgFilterMax)</div><div class="ttdef"><b>Definition:</b> <a href="a00887_source.html#l00511">timers.c:511</a></div></div>
<div class="ttc" id="aa02869_html_a34db7603fdeb49fef752d4362124d5c2"><div class="ttname"><a href="a02869.html#a34db7603fdeb49fef752d4362124d5c2">tagQ::hwndDblClk</a></div><div class="ttdeci">HWND hwndDblClk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02174">userk.h:2174</a></div></div>
<div class="ttc" id="aa03257_html_acdbf053b054e159961f2ba3d6e577bfc"><div class="ttname"><a href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a></div><div class="ttdeci">BOOL gfAllowForegroundActivate</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00060">kernel/globals.c:60</a></div></div>
<div class="ttc" id="aa03290_html_a8e55eab39af5bc9e6f4bf22b243cda82"><div class="ttname"><a href="a03290.html#a8e55eab39af5bc9e6f4bf22b243cda82">xxxMouseActivate</a></div><div class="ttdeci">int xxxMouseActivate(PTHREADINFO pti, PWND pwnd, UINT message, LPPOINT lppt, int ht)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02179">kernel/input.c:2179</a></div></div>
<div class="ttc" id="aa03290_html_a68ac12a88a920588a518cd2dcc3a16c4"><div class="ttname"><a href="a03290.html#a68ac12a88a920588a518cd2dcc3a16c4">CheckOnTop</a></div><div class="ttdeci">BOOL CheckOnTop(PTHREADINFO pti, PWND pwndTop, UINT message)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01972">kernel/input.c:1972</a></div></div>
<div class="ttc" id="aa00953_html_a6f8d160657d70c89baa1493d9425703f"><div class="ttname"><a href="a00953.html#a6f8d160657d70c89baa1493d9425703f">WM_SYSTIMER</a></div><div class="ttdeci">#define WM_SYSTIMER</div><div class="ttdef"><b>Definition:</b> <a href="a00953_source.html#l01194">bench.c:1194</a></div></div>
<div class="ttc" id="aa02581_html_a2778d611c2b27395e559c94d05732e1f"><div class="ttname"><a href="a02581.html#a2778d611c2b27395e559c94d05732e1f">tagWND::rcWindow</a></div><div class="ttdeci">RECT rcWindow</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01398">user.h:1398</a></div></div>
<div class="ttc" id="aa02581_html"><div class="ttname"><a href="a02581.html">tagWND</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01388">user.h:1388</a></div></div>
<div class="ttc" id="aa03257_html_a01d6b23c241a057b5e276bc3095a01eb"><div class="ttname"><a href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a></div><div class="ttdeci">PQ gpqForeground</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00133">kernel/globals.c:133</a></div></div>
<div class="ttc" id="aa02981_html"><div class="ttname"><a href="a02981.html">tagTIMER</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02864">userk.h:2864</a></div></div>
<div class="ttc" id="aa02581_html_a6053af0b243b6737640988eb63081de3"><div class="ttname"><a href="a02581.html#a6053af0b243b6737640988eb63081de3">tagWND::spwndParent</a></div><div class="ttdeci">struct tagWND * spwndParent</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01392">user.h:1392</a></div></div>
<div class="ttc" id="aa02757_html_aa2f09a6cb1d75cf4ee45937849af1dc6"><div class="ttname"><a href="a02757.html#aa2f09a6cb1d75cf4ee45937849af1dc6">tagAAS::tidActDeact</a></div><div class="ttdeci">DWORD tidActDeact</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01476">userk.h:1476</a></div></div>
<div class="ttc" id="aa02793_html_a44bfbf1bad1abd1c46618c96f982aec4"><div class="ttname"><a href="a02793.html#a44bfbf1bad1abd1c46618c96f982aec4">tagKL::hkl</a></div><div class="ttdeci">HKL hkl</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01654">userk.h:1654</a></div></div>
<div class="ttc" id="aa02757_html_ab68df3fa1c26a296ef73482d8f614696"><div class="ttname"><a href="a02757.html#ab68df3fa1c26a296ef73482d8f614696">tagAAS::fQueueNotify</a></div><div class="ttdeci">UINT fQueueNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01478">userk.h:1478</a></div></div>
<div class="ttc" id="aa02869_html_aa187e19d8d7e6018ddfbe3aaa9156240"><div class="ttname"><a href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">tagQ::spwndFocus</a></div><div class="ttdeci">PWND spwndFocus</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02167">userk.h:2167</a></div></div>
<div class="ttc" id="aa00824_html_a33338ab17ca4eb073cf36ecc1ae32435"><div class="ttname"><a href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a></div><div class="ttdeci">PQMSG AllocQEntry(PMLIST pml)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02258">queue.c:2258</a></div></div>
<div class="ttc" id="aa00686_html_a1dc7b5d2bcb53d6272a655ff64427cb3"><div class="ttname"><a href="a00686.html#a1dc7b5d2bcb53d6272a655ff64427cb3">xxxActivateThisWindow</a></div><div class="ttdeci">BOOL xxxActivateThisWindow(PWND pwnd, DWORD tidLoseForeground, DWORD fFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l00430">focusact.c:430</a></div></div>
<div class="ttc" id="aa02889_html_a97845e5f321fb758821ac99bd53840de"><div class="ttname"><a href="a02889.html#a97845e5f321fb758821ac99bd53840de">tagTHREADINFO::iCursorLevel</a></div><div class="ttdeci">int iCursorLevel</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02330">userk.h:2330</a></div></div>
<div class="ttc" id="aa03290_html_a155a894ac34924dc3551affcf39edd32"><div class="ttname"><a href="a03290.html#a155a894ac34924dc3551affcf39edd32">CancelForegroundActivate</a></div><div class="ttdeci">void CancelForegroundActivate()</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01316">kernel/input.c:1316</a></div></div>
<div class="ttc" id="aa03290_html_a6ae751736a3e6ef5b3f10816af604719"><div class="ttname"><a href="a03290.html#a6ae751736a3e6ef5b3f10816af604719">_GetMessagePos</a></div><div class="ttdeci">DWORD _GetMessagePos(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01143">kernel/input.c:1143</a></div></div>
<div class="ttc" id="aa00689_html_a5c0ed66b17009c8015022673ff5fcbdc"><div class="ttname"><a href="a00689.html#a5c0ed66b17009c8015022673ff5fcbdc">gptSSCursor</a></div><div class="ttdeci">POINT gptSSCursor</div><div class="ttdef"><b>Definition:</b> <a href="a00875_source.html#l00015">syscmd.c:15</a></div></div>
<div class="ttc" id="aa02869_html_a9c78a46a532787c63a126570d8a56680"><div class="ttname"><a href="a02869.html#a9c78a46a532787c63a126570d8a56680">tagQ::ptiSysLock</a></div><div class="ttdeci">PTHREADINFO ptiSysLock</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02159">userk.h:2159</a></div></div>
<div class="ttc" id="aa03290_html_a51ccaa0d03e99d3be71c4ac54a262154"><div class="ttname"><a href="a03290.html#a51ccaa0d03e99d3be71c4ac54a262154">SleepInputIdle</a></div><div class="ttdeci">void SleepInputIdle(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l04959">kernel/input.c:4959</a></div></div>
<div class="ttc" id="aa02905_html"><div class="ttname"><a href="a02905.html">tagPROCESSINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02386">userk.h:2386</a></div></div>
<div class="ttc" id="aa02457_html_a99314e2f6ea6b552b9538bbe7b7e64ba"><div class="ttname"><a href="a02457.html#a99314e2f6ea6b552b9538bbe7b7e64ba">_LARGE_UNICODE_STRING::Buffer</a></div><div class="ttdeci">PWSTR Buffer</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00284">user.h:284</a></div></div>
<div class="ttc" id="aa00899_html_aa8e750304c0b123842e49af384460e26"><div class="ttname"><a href="a00899.html#aa8e750304c0b123842e49af384460e26">HotKeyToWindow</a></div><div class="ttdeci">PWND HotKeyToWindow(DWORD)</div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00038">winhtky.c:38</a></div></div>
<div class="ttc" id="aa00371_html_a41f433389f20db57f042022a662e96de"><div class="ttname"><a href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a></div><div class="ttdeci">#define RIP_WARNING</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00029">winerrp.h:29</a></div></div>
<div class="ttc" id="aa00671_html_a269a5b2fe3144f017cd9f9530cc56409"><div class="ttname"><a href="a00671.html#a269a5b2fe3144f017cd9f9530cc56409">DWP_GetEnabledPopup</a></div><div class="ttdeci">PWND DWP_GetEnabledPopup(PWND pwndStart)</div><div class="ttdef"><b>Definition:</b> <a href="a00671_source.html#l00122">dwp.c:122</a></div></div>
<div class="ttc" id="aa02869_html_ade15a80896abdba1533b909440c29699"><div class="ttname"><a href="a02869.html#ade15a80896abdba1533b909440c29699">tagQ::caret</a></div><div class="ttdeci">CARET caret</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02182">userk.h:2182</a></div></div>
<div class="ttc" id="aa03290_html_a3c78db181c4cbc63a66159f9de7b0b22"><div class="ttname"><a href="a03290.html#a3c78db181c4cbc63a66159f9de7b0b22">KEYSTATESIZE</a></div><div class="ttdeci">#define KEYSTATESIZE</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00103">kernel/input.c:103</a></div></div>
<div class="ttc" id="aa03290_html_a41c36c29c72ea20161333931eaa8302f"><div class="ttname"><a href="a03290.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a></div><div class="ttdeci">void CleanEventMessage(PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02129">queue.c:2129</a></div></div>
<div class="ttc" id="aa02581_html_ae7a5a1d213bfe6dce2e6eab68a2a8bb8"><div class="ttname"><a href="a02581.html#ae7a5a1d213bfe6dce2e6eab68a2a8bb8">tagWND::lpfnWndProc</a></div><div class="ttdeci">WNDPROC_PWND lpfnWndProc</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01401">user.h:1401</a></div></div>
<div class="ttc" id="aa03290_html_a20d5203e35ce4aba335668b5bac40170"><div class="ttname"><a href="a03290.html#a20d5203e35ce4aba335668b5bac40170">CTS_TRANSFER</a></div><div class="ttdeci">#define CTS_TRANSFER</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05441">kernel/input.c:5441</a></div></div>
<div class="ttc" id="aa03290_html_a51cfc38140186482e8362d7bf1d3aa20"><div class="ttname"><a href="a03290.html#a51cfc38140186482e8362d7bf1d3aa20">FreeQEntry</a></div><div class="ttdeci">void FreeQEntry(PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02372">queue.c:2372</a></div></div>
<div class="ttc" id="aa02649_html_a51167c8ff7f1cc33e44ee9777e1016c9"><div class="ttname"><a href="a02649.html#a51167c8ff7f1cc33e44ee9777e1016c9">tagCLIENTTHREADINFO::CTIF_flags</a></div><div class="ttdeci">UINT CTIF_flags</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02216">user.h:2216</a></div></div>
<div class="ttc" id="aa03290_html_a72e82eeda3a22802abb8bd4b4bfb5c61"><div class="ttname"><a href="a03290.html#a72e82eeda3a22802abb8bd4b4bfb5c61">CloseScrennSaverWindow</a></div><div class="ttdeci">BOOL CloseScrennSaverWindow(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l03089">kernel/input.c:3089</a></div></div>
<div class="ttc" id="aa00824_html_a38b809c615e10eca863b213d461e7040"><div class="ttname"><a href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a></div><div class="ttdeci">void CalcStartCursorHide(PW32PROCESS pwp, DWORD timeAdd)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00431">queue.c:431</a></div></div>
<div class="ttc" id="aa00365_html_a976181f00e2ce3d0df4b770ea93f8443"><div class="ttname"><a href="a00365.html#a976181f00e2ce3d0df4b770ea93f8443">_GetWindow</a></div><div class="ttdeci">PWND _GetWindow(PWND pwnd, UINT cmd)</div><div class="ttdef"><b>Definition:</b> <a href="a03752_source.html#l00507">rtl/wow.c:507</a></div></div>
<div class="ttc" id="aa03290_html_aec213f5f9f340ff4a0b79a493c1c9abb"><div class="ttname"><a href="a03290.html#aec213f5f9f340ff4a0b79a493c1c9abb">GetMouseKeyFlags</a></div><div class="ttdeci">UINT GetMouseKeyFlags(PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l03241">kernel/input.c:3241</a></div></div>
<div class="ttc" id="aa03257_html_a3c299e89eb5b0923ac37cc8d29c65d06"><div class="ttname"><a href="a03257.html#a3c299e89eb5b0923ac37cc8d29c65d06">gcxMouseHover</a></div><div class="ttdeci">UINT gcxMouseHover</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00498">kernel/globals.c:498</a></div></div>
<div class="ttc" id="aa00872_html_a71170c4c5e4c60d4bc657fe52eb8d8d2"><div class="ttname"><a href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a></div><div class="ttdeci">BOOL xxxSetWindowPos(PWND pwnd, PWND pwndInsertAfter, int x, int y, int cx, int cy, UINT flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00872_source.html#l01169">swp.c:1169</a></div></div>
<div class="ttc" id="aa02869_html_a00f55b93fb49e91ab92e90fde747d716"><div class="ttname"><a href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">tagQ::spwndActive</a></div><div class="ttdeci">PWND spwndActive</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02168">userk.h:2168</a></div></div>
<div class="ttc" id="aa02593_html_ac8857c754110e179cc769f84373117ca"><div class="ttname"><a href="a02593.html#ac8857c754110e179cc769f84373117ca">tagHOOK::flags</a></div><div class="ttdeci">UINT flags</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01476">user.h:1476</a></div></div>
<div class="ttc" id="aa00899_html_af1b5f58e67f1282eed05c0c519866f7c"><div class="ttname"><a href="a00899.html#af1b5f58e67f1282eed05c0c519866f7c">IsMenuStarted</a></div><div class="ttdeci">__inline BOOL IsMenuStarted(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l03521">userk.h:3521</a></div></div>
<div class="ttc" id="aa03257_html_a106fec4487922d9baa52acc8bfee1c07"><div class="ttname"><a href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a></div><div class="ttdeci">PQ gpqCursor</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00135">kernel/globals.c:135</a></div></div>
<div class="ttc" id="aa02857_html_acaac4c4abe64b478521a44ad7f1d692b"><div class="ttname"><a href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">tagQMSG::ExtraInfo</a></div><div class="ttdeci">LONG ExtraInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02052">userk.h:2052</a></div></div>
<div class="ttc" id="aa03290_html_a0a3fd3f307e80195c7f13545ec5fbcff"><div class="ttname"><a href="a03290.html#a0a3fd3f307e80195c7f13545ec5fbcff">WakeSomeone</a></div><div class="ttdeci">void WakeSomeone(PQ pq, UINT message, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01460">kernel/input.c:1460</a></div></div>
<div class="ttc" id="aa02881_html_a0fac7dfac3f4208f91a3707ef2c25568"><div class="ttname"><a href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">tagTDB::pwti</a></div><div class="ttdeci">PWOWTHREADINFO pwti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02235">userk.h:2235</a></div></div>
<div class="ttc" id="aa03257_html_a400c45d213332277ff223c8c26996f88"><div class="ttname"><a href="a03257.html#a400c45d213332277ff223c8c26996f88">gafAsyncKeyState</a></div><div class="ttdeci">BYTE gafAsyncKeyState[CBKEYSTATE]</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00242">kernel/globals.c:242</a></div></div>
<div class="ttc" id="aa02869_html_aeb913440d6660cc91daeba2052f18f1f"><div class="ttname"><a href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">tagQ::cLockCount</a></div><div class="ttdeci">USHORT cLockCount</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02190">userk.h:2190</a></div></div>
<div class="ttc" id="aa02513_html_a125933441b95aca04386827b052dfe42"><div class="ttname"><a href="a02513.html#a125933441b95aca04386827b052dfe42">tagSERVERINFO::dwKeyCache</a></div><div class="ttdeci">DWORD dwKeyCache</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01046">user.h:1046</a></div></div>
<div class="ttc" id="aa00365_html_a71c025f23da9f633f32d79fa661dac06"><div class="ttname"><a href="a00365.html#a71c025f23da9f633f32d79fa661dac06">CalcWakeMask</a></div><div class="ttdeci">UINT CalcWakeMask(UINT wMsgFilterMin, UINT wMsgFilterMax)</div><div class="ttdef"><b>Definition:</b> <a href="a03296_source.html#l00043">rtl/input.c:43</a></div></div>
<div class="ttc" id="aa02649_html_ad7384d5f6cca06e0d245aaa350ba6e22"><div class="ttname"><a href="a02649.html#ad7384d5f6cca06e0d245aaa350ba6e22">tagCLIENTTHREADINFO::fsWakeBitsJournal</a></div><div class="ttdeci">WORD fsWakeBitsJournal</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02219">user.h:2219</a></div></div>
<div class="ttc" id="aa03290_html_aa8e4cc5f838fadab6795b0c64383ad96"><div class="ttname"><a href="a03290.html#aa8e4cc5f838fadab6795b0c64383ad96">xxxInternalGetMessage</a></div><div class="ttdeci">BOOL xxxInternalGetMessage(LPMSG lpMsg, HWND hwndFilter, UINT msgMin, UINT msgMax, UINT flags, BOOL fGetMessage)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00220">kernel/input.c:220</a></div></div>
<div class="ttc" id="aa00293_html_a41d387d1b2d42169cbaa2092c8a02abf"><div class="ttname"><a href="a00293.html#a41d387d1b2d42169cbaa2092c8a02abf">ValidateHwnd</a></div><div class="ttdeci">#define ValidateHwnd(hwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00293_source.html#l00090">immcli.h:90</a></div></div>
<div class="ttc" id="aa00824_html_aeafdb7a2066a7b9a1c036e2db4ca0f35"><div class="ttname"><a href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a></div><div class="ttdeci">void DestroyQueue(PQ pq, PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01511">queue.c:1511</a></div></div>
<div class="ttc" id="aa03257_html_a190de89de30966bef80ba543dcfaf812"><div class="ttname"><a href="a03257.html#a190de89de30966bef80ba543dcfaf812">iScreenSaveTimeOut</a></div><div class="ttdeci">int iScreenSaveTimeOut</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00482">kernel/globals.c:482</a></div></div>
<div class="ttc" id="aa03290_html_adc158fd691fd8f38a443ca9a299b1632"><div class="ttname"><a href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a></div><div class="ttdeci">void WakeInputIdle(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l04904">kernel/input.c:4904</a></div></div>
<div class="ttc" id="aa02457_html_abfb371817eb1c8f0d8a165bb2b798092"><div class="ttname"><a href="a02457.html#abfb371817eb1c8f0d8a165bb2b798092">_LARGE_UNICODE_STRING::Length</a></div><div class="ttdeci">ULONG Length</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00281">user.h:281</a></div></div>
<div class="ttc" id="aa03290_html_a24dc3b06f6569c1599489d59841e2058"><div class="ttname"><a href="a03290.html#a24dc3b06f6569c1599489d59841e2058">RestoreForegroundActivate</a></div><div class="ttdeci">void RestoreForegroundActivate()</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01347">kernel/input.c:1347</a></div></div>
<div class="ttc" id="aa00701_html_ad33153b28bc5b4fd2ebdb3e5d085a68d"><div class="ttname"><a href="a00701.html#ad33153b28bc5b4fd2ebdb3e5d085a68d">PhkFirst</a></div><div class="ttdeci">PHOOK PhkFirst(PTHREADINFO pti, int nFilterType)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l01729">hooks.c:1729</a></div></div>
<div class="ttc" id="aa03290_html_abb0d20ebbea0c335cdef469203890401"><div class="ttname"><a href="a03290.html#abb0d20ebbea0c335cdef469203890401">KeyStateLookasideBase</a></div><div class="ttdeci">PVOID KeyStateLookasideBase</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00088">kernel/input.c:88</a></div></div>
<div class="ttc" id="aa02793_html_ae380510bc898c92bcab23892035c8aa2"><div class="ttname"><a href="a02793.html#ae380510bc898c92bcab23892035c8aa2">tagKL::bCharsets</a></div><div class="ttdeci">DWORD bCharsets</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01656">userk.h:1656</a></div></div>
<div class="ttc" id="aa03290_html_a412e5db9753a1a73ff980b89cce66354"><div class="ttname"><a href="a03290.html#a412e5db9753a1a73ff980b89cce66354">InitKeyStateLookaside</a></div><div class="ttdeci">NTSTATUS InitKeyStateLookaside()</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01594">kernel/input.c:1594</a></div></div>
<div class="ttc" id="aa02889_html_abb1184e0c5805b5ad89b79dcc2bd17c8"><div class="ttname"><a href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">tagTHREADINFO::rpdesk</a></div><div class="ttdeci">PDESKTOP rpdesk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02288">userk.h:2288</a></div></div>
<div class="ttc" id="aa00899_html_aadce81eb182c2355be276b7a450d8101"><div class="ttname"><a href="a00899.html#aadce81eb182c2355be276b7a450d8101">IsSomeOneInMenuMode</a></div><div class="ttdeci">__inline BOOL IsSomeOneInMenuMode(void)</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l03525">userk.h:3525</a></div></div>
<div class="ttc" id="aa03290_html_ac2ac12bbb64bf174d45df0e65d717f84"><div class="ttname"><a href="a03290.html#ac2ac12bbb64bf174d45df0e65d717f84">xxxMouseHoverTimer</a></div><div class="ttdeci">LONG xxxMouseHoverTimer(PWND pwnd, UINT msg, DWORD id, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02377">kernel/input.c:2377</a></div></div>
<div class="ttc" id="aa03257_html_a66d75018ac18b148273ed2f14fd0e186"><div class="ttname"><a href="a03257.html#a66d75018ac18b148273ed2f14fd0e186">gspwndScreenCapture</a></div><div class="ttdeci">PWND gspwndScreenCapture</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00070">kernel/globals.c:70</a></div></div>
<div class="ttc" id="aa00857_html_a69ab51ee72ab28ff78e0a7f2f902825b"><div class="ttname"><a href="a00857.html#a69ab51ee72ab28ff78e0a7f2f902825b">xxxSnapWindow</a></div><div class="ttdeci">BOOL xxxSnapWindow(PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00857_source.html#l00028">snapshot.c:28</a></div></div>
<div class="ttc" id="aa03290_html_a555a50540fc3e5009b8d9262e0702592"><div class="ttname"><a href="a03290.html#a555a50540fc3e5009b8d9262e0702592">ReattachThreads</a></div><div class="ttdeci">BOOL ReattachThreads(BOOL fJournalAttach)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05701">kernel/input.c:5701</a></div></div>
<div class="ttc" id="aa02889_html_aea8fcdf7513cfa8972ff27524296079b"><div class="ttname"><a href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">tagTHREADINFO::pq</a></div><div class="ttdeci">struct tagQ * pq</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02273">userk.h:2273</a></div></div>
<div class="ttc" id="aa00842_html_a4a4a6ef58238afeb2930d10ed87d2853"><div class="ttname"><a href="a00842.html#a4a4a6ef58238afeb2930d10ed87d2853">QueueNotifyMessage</a></div><div class="ttdeci">void QueueNotifyMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l00888">sendmsg.c:888</a></div></div>
<div class="ttc" id="aa03290_html_acbf7182e6530b750eed27ef83e03c85f"><div class="ttname"><a href="a03290.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a></div><div class="ttdeci">void CheckProcessForeground(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00172">kernel/input.c:172</a></div></div>
<div class="ttc" id="aa02889_html_a6f56a147ff76c3fc48c358f05adb0473"><div class="ttname"><a href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">tagTHREADINFO::pcti</a></div><div class="ttdeci">PCLIENTTHREADINFO pcti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02280">userk.h:2280</a></div></div>
<div class="ttc" id="aa02857_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">tagQMSG::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02054">userk.h:2054</a></div></div>
<div class="ttc" id="aa00899_html_ac2181d07596893ed44d18aa267ce4d23"><div class="ttname"><a href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a></div><div class="ttdeci">VOID LeaveCrit(VOID)</div></div>
<div class="ttc" id="aa00812_html_a5fb5c8d8d77f78f43a8154e065390763"><div class="ttname"><a href="a00812.html#a5fb5c8d8d77f78f43a8154e065390763">xxxSimpleDoSyncPaint</a></div><div class="ttdeci">VOID xxxSimpleDoSyncPaint(PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00812_source.html#l00704">paint.c:704</a></div></div>
<div class="ttc" id="aa03290_html_ac5221341dcd1cc2116f08477d5fe85f4"><div class="ttname"><a href="a03290.html#ac5221341dcd1cc2116f08477d5fe85f4">AllocKeyState</a></div><div class="ttdeci">PBYTE AllocKeyState(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01625">kernel/input.c:1625</a></div></div>
<div class="ttc" id="aa03290_html_a9eb8f3351ef77ddcac4a4f2a7375a1a2"><div class="ttname"><a href="a03290.html#a9eb8f3351ef77ddcac4a4f2a7375a1a2">_AttachThreadInput</a></div><div class="ttdeci">BOOL _AttachThreadInput(PTHREADINFO ptiAttach, PTHREADINFO ptiAttachTo, BOOL fAttach)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05871">kernel/input.c:5871</a></div></div>
<div class="ttc" id="aa03608_html_afd1a0e78d1f88954d93e48ab3821781f"><div class="ttname"><a href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a></div><div class="ttdeci">typedef UINT(FAR WINAPI *MSGSOUNDPROC)()</div></div>
<div class="ttc" id="aa02545_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a02545.html#a774eeae0f007ae3ea612baf38cd38936">_THROBJHEAD::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01140">user.h:1140</a></div></div>
<div class="ttc" id="aa02869_html_a683294acdd2ae8355c6cfbf49c260374"><div class="ttname"><a href="a02869.html#a683294acdd2ae8355c6cfbf49c260374">tagQ::spcurCurrent</a></div><div class="ttdeci">PCURSOR spcurCurrent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02184">userk.h:2184</a></div></div>
<div class="ttc" id="aa00824_html_a9fdadf9722ab6b6f80c2f840f95b2fd3"><div class="ttname"><a href="a00824.html#a9fdadf9722ab6b6f80c2f840f95b2fd3">xxxSleepThread</a></div><div class="ttdeci">BOOL xxxSleepThread(UINT fsWakeMask, DWORD Timeout, BOOL fInputIdle)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03096">queue.c:3096</a></div></div>
<div class="ttc" id="aa02857_html_ac4e11a54fcd4eb693fc0c04630804f67"><div class="ttname"><a href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">tagQMSG::dwQEvent</a></div><div class="ttdeci">DWORD dwQEvent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02053">userk.h:2053</a></div></div>
<div class="ttc" id="aa03290_html_ae115b86b442f263c94c5219ccc4240cd"><div class="ttname"><a href="a03290.html#ae115b86b442f263c94c5219ccc4240cd">ResetMouseHover</a></div><div class="ttdeci">void ResetMouseHover(POINT pt)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02457">kernel/input.c:2457</a></div></div>
<div class="ttc" id="aa03290_html_ad583843a0b492cedbd2015698a00caae"><div class="ttname"><a href="a03290.html#ad583843a0b492cedbd2015698a00caae">CANCEL_FOCUSSTATE</a></div><div class="ttdeci">#define CANCEL_FOCUSSTATE</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00100">kernel/input.c:100</a></div></div>
<div class="ttc" id="aa00812_html_ac449d90b41476ac08ccf596bf2f8ed43"><div class="ttname"><a href="a00812.html#ac449d90b41476ac08ccf596bf2f8ed43">DoPaint</a></div><div class="ttdeci">BOOL DoPaint(PWND pwndFilter, LPMSG lpMsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00812_source.html#l00548">paint.c:548</a></div></div>
<div class="ttc" id="aa03290_html_a83215bd1e050fef3d493dba84ec7d241"><div class="ttname"><a href="a03290.html#a83215bd1e050fef3d493dba84ec7d241">PATHTAKEN2</a></div><div class="ttdeci">#define PATHTAKEN2(x)</div></div>
<div class="ttc" id="aa03290_html_a4a3403c63c49e44a7fa551d0d6f475b0"><div class="ttname"><a href="a03290.html#a4a3403c63c49e44a7fa551d0d6f475b0">DUMPSUBPATHTAKEN</a></div><div class="ttdeci">#define DUMPSUBPATHTAKEN(p, x)</div></div>
<div class="ttc" id="aa00899_html_a70b09c3e2b495630f4205d34be505afb"><div class="ttname"><a href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a></div><div class="ttdeci">VOID CheckLock(PVOID pobj)</div></div>
<div class="ttc" id="aa02857_html_ae10093b6e4748c1e5b22536acccde083"><div class="ttname"><a href="a02857.html#ae10093b6e4748c1e5b22536acccde083">tagQMSG::pqmsgNext</a></div><div class="ttdeci">struct tagQMSG * pqmsgNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02049">userk.h:2049</a></div></div>
<div class="ttc" id="aa03290_html_a99a70efa3fef53480bd7b13a85f3a7c1"><div class="ttname"><a href="a03290.html#a99a70efa3fef53480bd7b13a85f3a7c1">AdjustForCoalescing</a></div><div class="ttdeci">void AdjustForCoalescing(PMLIST pml, HWND hwnd, UINT message)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00881">kernel/input.c:881</a></div></div>
<div class="ttc" id="aa02889_html_a908f89e143de49ad52495f21d8231d8a"><div class="ttname"><a href="a02889.html#a908f89e143de49ad52495f21d8231d8a">tagTHREADINFO::idLast</a></div><div class="ttdeci">DWORD idLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02304">userk.h:2304</a></div></div>
<div class="ttc" id="aa03257_html_ab38a0855c4d4723984cd9e155d391e3e"><div class="ttname"><a href="a03257.html#ab38a0855c4d4723984cd9e155d391e3e">gppiWantForegroundPriority</a></div><div class="ttdeci">PPROCESSINFO gppiWantForegroundPriority</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00139">kernel/globals.c:139</a></div></div>
<div class="ttc" id="aa02609_html_a68937d60a6f49b7a8431db62b38ea721"><div class="ttname"><a href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">tagDESKTOPINFO::spwnd</a></div><div class="ttdeci">struct tagWND * spwnd</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01603">user.h:1603</a></div></div>
<div class="ttc" id="aa00371_html_adbdd8355d15a97b6f3a9e4766e6a2cc1"><div class="ttname"><a href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a></div><div class="ttdeci">#define RIPERR1(idErr, flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00120">winerrp.h:120</a></div></div>
<div class="ttc" id="aa02889_html"><div class="ttname"><a href="a02889.html">tagTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02260">userk.h:2260</a></div></div>
<div class="ttc" id="aa00371_html_a906cb0845450a5d5422ce513ecd8a32f"><div class="ttname"><a href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a></div><div class="ttdeci">#define RIPMSG2(flags, szFmt, p1, p2)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00133">winerrp.h:133</a></div></div>
<div class="ttc" id="aa02581_html_a6171c9000ea2060597a9bcf498ee0316"><div class="ttname"><a href="a02581.html#a6171c9000ea2060597a9bcf498ee0316">tagWND::spwndChild</a></div><div class="ttdeci">struct tagWND * spwndChild</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01393">user.h:1393</a></div></div>
<div class="ttc" id="aa03290_html_ab620b9fb400fd27803729c62046f5bb1"><div class="ttname"><a href="a03290.html#ab620b9fb400fd27803729c62046f5bb1">xxxSkipSysMsg</a></div><div class="ttdeci">void xxxSkipSysMsg(PTHREADINFO pti, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02864">kernel/input.c:2864</a></div></div>
<div class="ttc" id="aa03290_html_a625f273e3c887a8cf38f78db6d144bca"><div class="ttname"><a href="a03290.html#a625f273e3c887a8cf38f78db6d144bca">ProcessUpdateKeyStateEvent</a></div><div class="ttdeci">void ProcessUpdateKeyStateEvent(PQ pq, PBYTE pbKeyState)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01816">kernel/input.c:1816</a></div></div>
<div class="ttc" id="aa03257_html_a326757fcfe334f2ffd59d64d4645d37a"><div class="ttname"><a href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a></div><div class="ttdeci">PDESKTOP grpdeskRitInput</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00187">kernel/globals.c:187</a></div></div>
<div class="ttc" id="aa03743_html_a6fff890dabd74b268fbcba3368ecc560"><div class="ttname"><a href="a03743.html#a6fff890dabd74b268fbcba3368ecc560">_GetDesktopWindow</a></div><div class="ttdeci">PWND _GetDesktopWindow(void)</div><div class="ttdef"><b>Definition:</b> <a href="a03743_source.html#l00229">client/wow.c:229</a></div></div>
<div class="ttc" id="aa00347_html_ae16e833a609f99656ad41979a79aeb72"><div class="ttname"><a href="a00347.html#ae16e833a609f99656ad41979a79aeb72">FAKE_KEYSTROKE</a></div><div class="ttdeci">#define FAKE_KEYSTROKE</div><div class="ttdef"><b>Definition:</b> <a href="a00347_source.html#l00049">kbd.h:49</a></div></div>
<div class="ttc" id="aa02889_html_a99fe3da4061cf81a351510d8e24abe5b"><div class="ttname"><a href="a02889.html#a99fe3da4061cf81a351510d8e24abe5b">tagTHREADINFO::psmsCurrent</a></div><div class="ttdeci">struct tagSMS * psmsCurrent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02299">userk.h:2299</a></div></div>
<div class="ttc" id="aa03290_html_ac631ad721186e0a430ac07b6d6189257"><div class="ttname"><a href="a03290.html#ac631ad721186e0a430ac07b6d6189257">_PostMessage</a></div><div class="ttdeci">BOOL _PostMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00918">kernel/input.c:918</a></div></div>
<div class="ttc" id="aa02889_html_a3f4ef466a82433ef538cc8a35f4d0907"><div class="ttname"><a href="a02889.html#a3f4ef466a82433ef538cc8a35f4d0907">tagTHREADINFO::fsChangeBitsRemoved</a></div><div class="ttdeci">USHORT fsChangeBitsRemoved</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02277">userk.h:2277</a></div></div>
<div class="ttc" id="aa02889_html_a76d4881aa4c15330103e83a80e6b5dc7"><div class="ttname"><a href="a02889.html#a76d4881aa4c15330103e83a80e6b5dc7">tagTHREADINFO::pDeskInfo</a></div><div class="ttdeci">PDESKTOPINFO pDeskInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02291">userk.h:2291</a></div></div>
<div class="ttc" id="aa02653_html_a68937d60a6f49b7a8431db62b38ea721"><div class="ttname"><a href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">tagCARET::spwnd</a></div><div class="ttdeci">struct tagWND * spwnd</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02239">user.h:2239</a></div></div>
<div class="ttc" id="aa02869_html_aa087431e9054c89479d13cb6d4bbf0b5"><div class="ttname"><a href="a02869.html#aa087431e9054c89479d13cb6d4bbf0b5">tagQ::dwMouseHoverTime</a></div><div class="ttdeci">DWORD dwMouseHoverTime</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02198">userk.h:2198</a></div></div>
<div class="ttc" id="aa02889_html_a64e1dadbca00e671a6b925590f57e268"><div class="ttname"><a href="a02889.html#a64e1dadbca00e671a6b925590f57e268">tagTHREADINFO::mlPost</a></div><div class="ttdeci">MLIST mlPost</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02276">userk.h:2276</a></div></div>
<div class="ttc" id="aa03290_html_a7da5c34879f1ae52420838f2676c6378"><div class="ttname"><a href="a03290.html#a7da5c34879f1ae52420838f2676c6378">PATHTAKEN3</a></div><div class="ttdeci">#define PATHTAKEN3(x)</div></div>
<div class="ttc" id="aa03290_html_a7cda2eaad1e3b8c5412b982d5b64fdfe"><div class="ttname"><a href="a03290.html#a7cda2eaad1e3b8c5412b982d5b64fdfe">xxxGetNextSysMsg</a></div><div class="ttdeci">PQMSG xxxGetNextSysMsg(PTHREADINFO pti, PQMSG pqmsgPrev, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02684">kernel/input.c:2684</a></div></div>
<div class="ttc" id="aa02889_html_a82665c77f0395ea674ade3c7a96bd9d1"><div class="ttname"><a href="a02889.html#a82665c77f0395ea674ade3c7a96bd9d1">tagTHREADINFO::ptLast</a></div><div class="ttdeci">POINT ptLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02303">userk.h:2303</a></div></div>
<div class="ttc" id="aa02905_html_a2306374fe9d8ff9df10b4a7491946258"><div class="ttname"><a href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">tagPROCESSINFO::ppiNext</a></div><div class="ttdeci">PPROCESSINFO ppiNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02389">userk.h:2389</a></div></div>
<div class="ttc" id="aa02581_html_a17d59d04094aef8b577c0aa781cdf2c6"><div class="ttname"><a href="a02581.html#a17d59d04094aef8b577c0aa781cdf2c6">tagWND::rcClient</a></div><div class="ttdeci">RECT rcClient</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01399">user.h:1399</a></div></div>
<div class="ttc" id="aa00899_html_adc99299add8f7128f863256c6901cf41"><div class="ttname"><a href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a></div><div class="ttdeci">void CheckPtiSysPeek(int where, PQ pq, DWORD newIdSysPeek)</div></div>
<div class="ttc" id="aa03257_html_af01477af415dcb7442680606f63b5e29"><div class="ttname"><a href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a></div><div class="ttdeci">PPROCESSINFO gppiStarting</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00138">kernel/globals.c:138</a></div></div>
<div class="ttc" id="aa00020_html_ad760da1dd81d9e84dee607d18edfde39"><div class="ttname"><a href="a00020.html#ad760da1dd81d9e84dee607d18edfde39">gpsi</a></div><div class="ttdeci">PSERVERINFO gpsi</div><div class="ttdef"><b>Definition:</b> <a href="a00020_source.html#l00039">clglobal.c:39</a></div></div>
<div class="ttc" id="aa03257_html_a0505c3ff32d34e510caf737f5fb72826"><div class="ttname"><a href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a></div><div class="ttdeci">DWORD gcSysExpunge</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00180">kernel/globals.c:180</a></div></div>
<div class="ttc" id="aa00824_html_a40077ba7267f3c31f389f3eeac9c4506"><div class="ttname"><a href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a></div><div class="ttdeci">void StoreQMessage(PQMSG pqmsg, PWND pwnd, UINT message, DWORD wParam, LONG lParam, DWORD dwQEvent, DWORD dwExtraInfo)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03502">queue.c:3502</a></div></div>
<div class="ttc" id="aa02793_html"><div class="ttname"><a href="a02793.html">tagKL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01649">userk.h:1649</a></div></div>
<div class="ttc" id="aa02593_html"><div class="ttname"><a href="a02593.html">tagHOOK</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01471">user.h:1471</a></div></div>
<div class="ttc" id="aa03257_html_a8534ae64a3a0d32b8727b62158bd1d34"><div class="ttname"><a href="a03257.html#a8534ae64a3a0d32b8727b62158bd1d34">gspwndInternalCapture</a></div><div class="ttdeci">PWND gspwndInternalCapture</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00075">kernel/globals.c:75</a></div></div>
<div class="ttc" id="aa02869_html_af0a73901f2264cfe048d588810333935"><div class="ttname"><a href="a02869.html#af0a73901f2264cfe048d588810333935">tagQ::spwndAltTab</a></div><div class="ttdeci">PWND spwndAltTab</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02180">userk.h:2180</a></div></div>
<div class="ttc" id="aa03290_html_ac43268187ecd11008c36d6e783bcf1f8"><div class="ttname"><a href="a03290.html#ac43268187ecd11008c36d6e783bcf1f8">KeyStateLookasideBounds</a></div><div class="ttdeci">PVOID KeyStateLookasideBounds</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00089">kernel/input.c:89</a></div></div>
<div class="ttc" id="aa03290_html_a3493fc168759a0e41f7cdc5cb16abde4"><div class="ttname"><a href="a03290.html#a3493fc168759a0e41f7cdc5cb16abde4">CancelInputState</a></div><div class="ttdeci">VOID CancelInputState(PTHREADINFO pti, DWORD cmd)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05344">kernel/input.c:5344</a></div></div>
<div class="ttc" id="aa03257_html_a53d970087b4067811d99a3001abe20fa"><div class="ttname"><a href="a03257.html#a53d970087b4067811d99a3001abe20fa">gSystemCPB</a></div><div class="ttdeci">DWORD gSystemCPB</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00215">kernel/globals.c:215</a></div></div>
<div class="ttc" id="aa02869_html_acaac4c4abe64b478521a44ad7f1d692b"><div class="ttname"><a href="a02869.html#acaac4c4abe64b478521a44ad7f1d692b">tagQ::ExtraInfo</a></div><div class="ttdeci">LONG ExtraInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02194">userk.h:2194</a></div></div>
<div class="ttc" id="aa02869_html"><div class="ttname"><a href="a02869.html">tagQ</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02156">userk.h:2156</a></div></div>
<div class="ttc" id="aa03257_html_ae6141080cfca7976a545c46fa30d5401"><div class="ttname"><a href="a03257.html#ae6141080cfca7976a545c46fa30d5401">gdwSysExpungeMask</a></div><div class="ttdeci">DWORD gdwSysExpungeMask</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00179">kernel/globals.c:179</a></div></div>
<div class="ttc" id="aa00725_html_ab8998458d1938a03a802e2b887dcb3d0"><div class="ttname"><a href="a00725.html#ab8998458d1938a03a802e2b887dcb3d0">HKLtoPKL</a></div><div class="ttdeci">PKL HKLtoPKL(HKL hkl)</div><div class="ttdef"><b>Definition:</b> <a href="a00725_source.html#l00037">kbdlyout.c:37</a></div></div>
<div class="ttc" id="aa00701_html_a541e8a7e575e8b23a5740db596eef34d"><div class="ttname"><a href="a00701.html#a541e8a7e575e8b23a5740db596eef34d">xxxCallJournalPlaybackHook</a></div><div class="ttdeci">DWORD xxxCallJournalPlaybackHook(PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l01450">hooks.c:1450</a></div></div>
<div class="ttc" id="aa00701_html_a3f27401daee77aa63faa3ff562de7207"><div class="ttname"><a href="a00701.html#a3f27401daee77aa63faa3ff562de7207">xxxCallMouseHook</a></div><div class="ttdeci">BOOL xxxCallMouseHook(UINT message, PMOUSEHOOKSTRUCT pmhs, BOOL fRemove)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l01326">hooks.c:1326</a></div></div>
<div class="ttc" id="aa03290_html_aff53b969878a227a8d1b2a15f3439fc9"><div class="ttname"><a href="a03290.html#aff53b969878a227a8d1b2a15f3439fc9">PostMove</a></div><div class="ttdeci">VOID PostMove(PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01192">kernel/input.c:1192</a></div></div>
<div class="ttc" id="aa02865_html_ad289943e39576dd5ba38e1fef83da6c9"><div class="ttname"><a href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">tagMLIST::pqmsgRead</a></div><div class="ttdeci">PQMSG pqmsgRead</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02148">userk.h:2148</a></div></div>
<div class="ttc" id="aa03290_html_a4679d8ea8690999a6c6c7c0cb245c879"><div class="ttname"><a href="a03290.html#a4679d8ea8690999a6c6c7c0cb245c879">THRESHOLD</a></div><div class="ttdeci">#define THRESHOLD</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l03133">kernel/input.c:3133</a></div></div>
<div class="ttc" id="aa03257_html_a84bd5c4f22ef2020477acced03c9edac"><div class="ttname"><a href="a03257.html#a84bd5c4f22ef2020477acced03c9edac">gptmrFirst</a></div><div class="ttdeci">PTIMER gptmrFirst</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00143">kernel/globals.c:143</a></div></div>
<div class="ttc" id="aa02869_html_ac8463e1b385969090970958b7a1a7c98"><div class="ttname"><a href="a02869.html#ac8463e1b385969090970958b7a1a7c98">tagQ::msgDblClk</a></div><div class="ttdeci">UINT msgDblClk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02172">userk.h:2172</a></div></div>
<div class="ttc" id="aa00347_html_aa8286b6273fa173b26ea440fde99d8c9"><div class="ttname"><a href="a00347.html#aa8286b6273fa173b26ea440fde99d8c9">EXTENDED_BIT</a></div><div class="ttdeci">#define EXTENDED_BIT</div><div class="ttdef"><b>Definition:</b> <a href="a00347_source.html#l00047">kbd.h:47</a></div></div>
<div class="ttc" id="aa02857_html"><div class="ttname"><a href="a02857.html">tagQMSG</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02048">userk.h:2048</a></div></div>
<div class="ttc" id="aa02757_html"><div class="ttname"><a href="a02757.html">tagAAS</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01474">userk.h:1474</a></div></div>
<div class="ttc" id="aa02869_html_a0cb223b5eb77a691d7e1a08ee0cf167a"><div class="ttname"><a href="a02869.html#a0cb223b5eb77a691d7e1a08ee0cf167a">tagQ::codeCapture</a></div><div class="ttdeci">UINT codeCapture</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02171">userk.h:2171</a></div></div>
<div class="ttc" id="aa00701_html_a4a596c02b66f7f049c18711b882e0b89"><div class="ttname"><a href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a></div><div class="ttdeci">int xxxCallHook(int nCode, DWORD wParam, DWORD lParam, int iHook)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l00954">hooks.c:954</a></div></div>
<div class="ttc" id="aa03290_html_a4856d1f1e3808b8a272edd102d0d78ef"><div class="ttname"><a href="a03290.html#a4856d1f1e3808b8a272edd102d0d78ef">PostInputMessage</a></div><div class="ttdeci">void PostInputMessage(PQ pq, PWND pwnd, UINT message, DWORD wParam, LONG lParam, DWORD dwExtraInfo)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01372">kernel/input.c:1372</a></div></div>
<div class="ttc" id="aa00638_html_a439658ba5849cd209ffc346d05cb508b"><div class="ttname"><a href="a00638.html#a439658ba5849cd209ffc346d05cb508b">LockQCursor</a></div><div class="ttdeci">PCURSOR LockQCursor(PQ pq, PCURSOR pcur)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00605">cursor.c:605</a></div></div>
<div class="ttc" id="aa00953_html_a428a91acf2c2439dc1a257708ee1f805"><div class="ttname"><a href="a00953.html#a428a91acf2c2439dc1a257708ee1f805">APIENTRY</a></div><div class="ttdeci">#define APIENTRY</div><div class="ttdef"><b>Definition:</b> <a href="a00953_source.html#l00005">bench.c:5</a></div></div>
<div class="ttc" id="aa02889_html_a09679d30cfd8c200ad9b8352eb155126"><div class="ttname"><a href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">tagTHREADINFO::cQuit</a></div><div class="ttdeci">int cQuit</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02306">userk.h:2306</a></div></div>
<div class="ttc" id="aa00824_html_ae4353c386ec9e86fd65fde7125ecabb0"><div class="ttname"><a href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a></div><div class="ttdeci">void DelQEntry(PMLIST pml, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02313">queue.c:2313</a></div></div>
<div class="ttc" id="aa03290_html_a7f3d348b55324c2d0626d410995a23bf"><div class="ttname"><a href="a03290.html#a7f3d348b55324c2d0626d410995a23bf">EqualMsg</a></div><div class="ttdeci">BOOL EqualMsg(PQMSG pqmsg1, PQMSG pqmsg2)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l02835">kernel/input.c:2835</a></div></div>
<div class="ttc" id="aa02857_html_a13aa0c37bd6a6afb5a5386b5946b36b5"><div class="ttname"><a href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">tagQMSG::pqmsgPrev</a></div><div class="ttdeci">struct tagQMSG * pqmsgPrev</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02050">userk.h:2050</a></div></div>
<div class="ttc" id="aa02869_html_af0ad3f886c56de3c6a971662e15ee861"><div class="ttname"><a href="a02869.html#af0ad3f886c56de3c6a971662e15ee861">tagQ::timeDblClk</a></div><div class="ttdeci">DWORD timeDblClk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02173">userk.h:2173</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_cd70cb5eb491250157f2d55d3ff4b13e.html">backup</a></li><li class="navelem"><a class="el" href="dir_ba2b673b566ba104b956abdc6dec0552.html">org</a></li><li class="navelem"><a class="el" href="dir_5bb0003d7907b45051943541418399f5.html">ntuser</a></li><li class="navelem"><a class="el" href="dir_2a0a56546b70a0973705719e6a88eab3.html">kernel</a></li><li class="navelem"><a class="el" href="a03290.html">input.c</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
